import urllib
import re
url = urllib.urlopen('http://tieba.baidu.com/p/2989654325').read()
pattern = r'src="(http:\/\/imgsrc\.baidu\.com\/forum\/.*?\.jpg)'
img = re.findall(pattern,url)
x = 0
for i in img:
urllib.urlretrieve(i,('d://'+str(x)+'.jpg'))
x+=1
转载于:https://my.oschina.net/u/947558/blog/279798