import requests f = open('test.jpg','wb') f.write(requests.get('https://upload.wikimedia.org/wikipedia/en/9/95/Test_image.jpg').content) f.close()