首页 > 其他 > 详细

瞎爬些图

时间:2018-03-22 16:54:24      阅读:219      评论:0      收藏:0      [点我收藏+]
 1 import urllib
 2 import re
 3 
 4 url = "https://www.duitang.com/search/?kw=%E9%AC%BC%E6%80%AA&type=feed"
 5 page = urllib.urlopen(url)
 6 html = page.read()
 7 
 8 imglist = re.findall(rsrc="(.*?\.(jpg|jpeg))",html)
 9 
10 x=0
11 
12 for imgurl in imglist:
13     urllib.urlretrieve(imgurl[0],/home/zl20163297/test/pachong/pics/guiguai/%d.jpg%x)
14     x+=1

瞎爬些图

原文:https://www.cnblogs.com/shixinzei/p/8624401.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!