1#Used to make requests
2import urllib.request
3
4x = urllib.request.urlopen('https://www.google.com/')
5print(x.read())
1>>> import urllib3
2>>> http = urllib3.PoolManager()
3>>> r = http.request('GET', 'http://httpbin.org/robots.txt')
4>>> r.status
5200
6>>> r.data
7'User-agent: *\nDisallow: /deny\n'
8
1#In Python 3.x, the urlretrieve function is located in the urllib.request module:
2from urllib.request import urlretrieve