import urllib2
import re
req=urllib2.urlopen('http://www.imooc.com/course/list')
buf=req.read()
listurl =re.findall(r'src=.+\.jpg',buf)
print listurl
i=0
for url in listurl:
f=open(str(i)+'.jpg','wb')
req=urllib2.urlopen(url)
buf=req.read()
f.write(buf)
i+=1
- 1 回答
- 0 关注
- 1890 浏览
添加回答
举报
0/150
提交
取消