import urllib2,urllib,re
html = urllib2.urlopen(r'http://*******').read()
imgs = re.findall('<img.*src="([^"]*)"',html)
for i in imgs:
file_name=i.split('/')[-1]
print file_name
path = './data/%s'%file_name
data = urllib.urlopen(i).read()
f = file(path,'wb')
f.write(data)
f.close()
转载于:https://my.oschina.net/sskill/blog/189302