繁体   English   中英

如何通过 url 形成 excel 表,通过 python 下载图像

[英]how to download images via python by taking url form a excel sheet

我有一张带有 url 图像的 excel 表,我可以使用 python 脚本下载它们吗? 如果是,那么代码是什么

试试这个代码,

'''Do pip install requests if requests module was not installed'''
import requests

listUrls = ['https://nandyembedly.herokuapp.com/static/favicon.ico']
for url in listUrls:
    res = requests.get(url).content
    with open(f"{url.split('/')[-1].split('.')[0]}.png",'wb') as f:
        f.write(res) 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM