导航

Python爬虫

Posted on 2016-05-25 14:36  4565892  阅读(100)  评论(0)    收藏  举报
weburl = "http://www.douban.com/"
content=urllib.urlopen(weburl).read()
ppp=r'"(https://img3.doubanio.com/.*?[\.jpg|\.png|\.gif]")'
mind=re.findall(ppp,content)
x=0
for i in mind:
print(i)
urllib.urlretrieve(i,"img"+os.sep+str(x)+".gif")
x+=1