1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| import requests
def downloadImg(url, name): url = url
res = requests.get(url)
with open(name, 'wb') as file: file.write(res.content)
imgUrlList = [ 'https://tuchuang.voooe.cn/images/2024/02/23/1.webp', 'https://tuchuang.voooe.cn/images/2024/02/23/2.webp', 'https://tuchuang.voooe.cn/images/2024/02/23/3.webp', 'https://tuchuang.voooe.cn/images/2024/02/23/4.webp' ]
nub = 1
for imgUrl in imgUrlList: downloadImg(imgUrl, str(nub) + '.webp')
nub += 1
|