为什么我下载图片看不清楚 或者是破图
# -*- coding: UTF-8 -*-
import urllib2
import re
import time
req = urllib2.urlopen('http://www.imooc.com/course/list?c=python')
buf =req.read()
listurl = re.findall(r'http://img.+.jpg',buf)
print listurl
i = 0
for url in listurl:
file = open('D:/python/'+str(i)+'.jpg','w')
req = urllib2.urlopen(url)
buf = req.read()
file.write(buf)
i += 1
time.sleep(1)