Python脚本1:批量获取图片下载到本地

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/github_35631540/article/details/80744868
#  根据图片链接列表获取图片保存到本地
#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

猜你喜欢

转载自blog.csdn.net/github_35631540/article/details/80744868