Jan-22-2018, 07:21 PM
I got a not found from the url you supplied.
I would use requests module to fetch image, something like:
(using different image)
I would use requests module to fetch image, something like:
(using different image)
import requests from io import open as iopen def fetch_image(img_ur, save_filename): img = requests.get(img_ur) if img.status_code == 200: with iopen(save_filename, 'wb') as f: f.write(img.content) else: print('Received error: {}'.format(img.status_code)) testlink = 'https://vignette.wikia.nocookie.net/pdsh/images/9/95/Prettygoldilocks.jpg' filename = 'Goldilocks.jpg' fetch_image(testlink, filename)