1response = requests.get("https://i.imgur.com/ExdKOOz.png")
2
3file = open("sample_image.png", "wb")
4file.write(response.content)
5file.close()
1import requests
2
3url = 'http://google.com/favicon.ico'
4r = requests.get(url, allow_redirects=True)
5open('google.ico', 'wb').write(r.content)
6
1import urllib.request, io
2url = 'http://www.elsecarrailway.co.uk/images/Events/TeddyBear-3.jpg'
3path = urllib.request.urlopen(url)
4meta = path.info()
5
6>>>meta.get(name="Content-Length")
7'269898' # ie 269kb