python requests retrieve image code example
Example 1: download image python
import urllib.request
image_url = 'https://bit.ly/2XuVzB4' #the image on the web
save_name = 'my_image.jpg' #local name to be saved
urllib.request.urlretrieve(image_url, save_name)
Example 2: get image image memeory size in url inpyton requests
import urllib.request, io
url = 'http://www.elsecarrailway.co.uk/images/Events/TeddyBear-3.jpg'
path = urllib.request.urlopen(url)
meta = path.info()
>>>meta.get(name="Content-Length")
'269898' # ie 269kb