I have a excel sheet with url of images can I use a python script to download them all? if yes then what will be the code
Advertisement
Answer
Try this code,
JavaScript
x
9
1
'''Do pip install requests if requests module was not installed'''
2
import requests
3
4
listUrls = ['https://nandyembedly.herokuapp.com/static/favicon.ico']
5
for url in listUrls:
6
res = requests.get(url).content
7
with open(f"{url.split('/')[-1].split('.')[0]}.png",'wb') as f:
8
f.write(res)
9