标签:pre import images .com lis += res imagelist 简单
import urllib.request
import re
response = urllib.request.urlopen("http://tieba.baidu.com/p/2460150866")
page = response.read()
page = page.decode(‘utf-8‘)
imageList = re.findall(r‘src="(.*?\.(jpg|png))" pic_ext‘,page)
j = 1
for i in imageList:
imgUrl = i[0]
urllib.request.urlretrieve(imgUrl,‘./images/%d.jpg‘%j)
j += 1
标签:pre import images .com lis += res imagelist 简单
原文地址:http://www.cnblogs.com/vsmart/p/7769032.html