I want to get the HTML source from a site ('example.com' for example).
I tried the following:
import urllib2
response = urllib2.urlopen("https://example.com")
page_source = response.read()
It says:
'No module named urllib2'
How can I prevent this error?
from requests import requestwith a usage likeresp = request('GET', <url>).pageSource = resp.text. Also what version of python are you using?