Here\'s my code:
import urllib2.request
response = urllib2.urlopen(\"http://www.google.com\")
html = response.read()
print(html)
Any help?
urllib2 is no longer available in Python 3You can try following code.
import urllib.request
res = urllib.request.urlopen('url')
output = res.read()
print(output)
You can get more idea about urllib.request from this link.
urllib3import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'url')
print(r.status)
print( r.headers)
print(r.data)
Also if you want more details about urllib3. follow this link.