Python实现批量下载指定链接图片后改名
import requests
urls = ['https://carpedx.com/images/5eb4d75agw1e28yri0h5fa.jpg','https://carpedx.com/images/5eb4d75agw1e28yri0h5fb.jpg']
names = ['a.jpg','b.jpg']
for i, url in enumerate(urls):
print(i)
response = requests.get(url)
with open(names[i], 'wb') as f:
f.write(response.content)
文档信息
- 本文作者:carpe
- 本文链接:https://carpedx.com/fragment/python-batch-download-of-images-and-renaming/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)