使用python下载图像

问题描述

嗨,我正在尝试使用 python 脚本下载图像,我的链接是 sharepoint sharebale 链接,但不知何故我无法这样做,因为我无法获得 url 的汤以及没有 wb流出来,网址:https://americanindustrialinc-my.sharepoint.com/:i:/p/dgordon/EVu-QqblQdVFqCSHSeD1qgsBKuWrQ7UV2CDCUP4v4bWfZg?e=0AWuG。 到目前为止我尝试过的代码

"""Downloads all the images at 'url'"""
soup = bs(urlopen(url))
parsed = list(urlparse(url))

for image in soup.findAll("img"):
    print ("Image: %(src)s",image)
    image_url = urlparse.urljoin(url,image['src'])
    filename = image["src"].split("/")[-1]
    outpath = os.path.join(os.getcwd(),filename)
    urlretrieve(image_url,outpath)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)