from urllib2 import urlopen, Request from bs4 import BeautifulSoup req1 = Request("https://stackoverflow.com/") # HTTPS html1 = urlopen(req1).read() req2 = Request("http://stackoverflow.com/") # HTTP html2 = urlopen(req2).read() bsObj1 = BeautifulSoup(html1, "html.parser") bsObj2 = BeautifulSoup(html2, "html.parser")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)