import re
import urllib
def getHtml(url):
page = urllib.urlopen(url)
html = page.read()
return html
def getImg(html):
reg =
r'src="(.+\.png)"'
imgre = re.compile(reg)
imglist = re.findall(imgre,html)
x =
1
for imgurl
in imglist:
urllib.urlretrieve(imgurl,
'%s.png' % x)
x +=
1
html = getHtml(
"http://172.25.254.100")
print getImg(html)
转载请注明原文地址: https://ju.6miu.com/read-668963.html