我下断点看了下,可以找到图片,但为什么不能下载呢?(代码如下)
#-*- coding:utf8 -*-
import re
import requests
f = open('zjjsource.txt','r')
html = f.read()f.close()
pic = re.findall('src="(.*?)"',html,re.M|re.S|re.I)
i=0
for each in pic:
print 'now downloading:'+each
pic = requests.get(each)
fp = open('pic\\'+str(i)+'.jpg','wb')
fp.write(pic.content)
fp.close()
i += 1