发布时间:2019-07-14 10:00:28编辑:auto阅读(2005)
#!/usr/bin/python
import re
import urllib
#def getHtml(url):
# urllib.open(url)
def getHtml(url):
page = urllib.urlopen(url)
html = page.read()
return html
def getImg(html):
reg = r'src="(.*?\.jpg)"'
imgre = re.compile(reg)
imglist = re.findall(imgre,html)
# return imglist
x = 1000
for imgurl in imglist:
urllib.urlretrieve(imgurl,'jpg/%s.jpg' % x)
x+=1
print imgurl
html = getHtml("http://bbs.voc.com.cn/topic-5094572-1-1.html")
getImg(html)
上一篇: shell perl python 剖析
下一篇: python 基础 条件语句
50953
50334
40953
37817
32283
29173
28061
22890
22853
21185
1037°
1718°
1403°
1337°
1597°
1433°
2087°
3629°
3545°
2503°