#coding:utf-8
#爬取58图片
import re
import urllib
import urllib2
url =raw_input('这里面输入链接:')
#url = http://gz.58.com/zufang/30278144021674x.shtml?entinfo=30278144021674_0&fzbref=0
huoquwangye = urllib2.urlopen(url)
html = huoquwangye.read()
zhenzhe = r'img data-src="(.*?)"'
for i in re.findall(zhenzhe,html):
webimage = i.split('/')[-1]
print webimage
urllib.urlretrieve(i,"image/%s" %webimage)
文件和图片文件夹同级