Python脚本1:批量获取图片下载到本地
【摘要】
# 根据图片链接列表获取图片保存到本地#coding=utf-8import urllib.requestimage_url = ['http://i2.bvimg.com/649796/f8b21c027df0a0c8.png','http://i2.bvimg.com/649796/792c5ad474c49308.jp...
-
# 根据图片链接列表获取图片保存到本地
-
#coding=utf-8
-
import urllib.request
-
image_url = [
-
'http://i2.bvimg.com/649796/f8b21c027df0a0c8.png',
-
'http://i2.bvimg.com/649796/792c5ad474c49308.jpg',
-
'http://i2.bvimg.com/649796/529498f8ac94a9ea.png',
-
'http://i2.bvimg.com/649796/2e5e331aab07f7e3.jpg',
-
'http://i2.bvimg.com/649796/a89c1236a325059d.png',
-
'http://i2.bvimg.com/649796/3618fa9647fe512e.jpg',
-
'http://i2.bvimg.com/649796/c9e44468856d94b3.png',
-
'http://i2.bvimg.com/649796/a8ca6bc1fb01c84f.jpg',
-
'http://i2.bvimg.com/649796/6f027d1cb7f45548.png',
-
'http://i2.bvimg.com/649796/e11401a0e3ab989b.jpg',
-
'http://i2.bvimg.com/649796/42b8382fb5e8211a.png',
-
'http://i2.bvimg.com/649796/48bb7e7f62cd6cc7.jpg',
-
'http://i2.bvimg.com/649796/0aa922b25a24e1ad.png',
-
'http://i2.bvimg.com/649796/9b2321b38534a662.jpg',
-
'http://i2.bvimg.com/649796/b55002be74b794ca.png',
-
'http://i2.bvimg.com/649796/f228df888f30efa3.jpg',
-
'http://i2.bvimg.com/649796/45028c9a8830156c.png',
-
'http://i2.bvimg.com/649796/25eb46043ea06863.jpg',
-
'http://i2.bvimg.com/649796/10e02b8dd126cfb3.png',
-
'http://i2.bvimg.com/649796/72a4d659fde343c4.jpg',
-
'http://i4.bvimg.com/649796/95aef107c08d44ea.png',
-
'http://i4.bvimg.com/649796/009e2431a561ba6e.jpg',
-
'http://i4.bvimg.com/649796/7b217a0b79c86359.jpg',
-
'http://i4.bvimg.com/649796/d688784e826fce36.jpg',
-
'http://i4.bvimg.com/649796/e55695f5d34b9e31.jpg',
-
'http://i4.bvimg.com/649796/4230cc57f7b4efc0.jpg'
-
]
-
i=1
-
for item in image_url:
-
urllib.request.urlretrieve(item,"E:\ckb\\%s.jpg"%(i))
-
i+=1
文章来源: fizzz.blog.csdn.net,作者:拿我格子衫来,版权归原作者所有,如需转载,请联系作者。
原文链接:fizzz.blog.csdn.net/article/details/80744868
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)