Answers for "requests not downloading an image"

2

requests download image

response = requests.get("https://i.imgur.com/ExdKOOz.png")

file = open("sample_image.png", "wb")
file.write(response.content)
file.close()
Posted by: Guest on May-25-2020
0

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
Posted by: Guest on September-18-2020

Python Answers by Framework

Browse Popular Code Answers by Language