python保存爬取的图片

用爬虫抓取图片的保存

 

保存图片

request=urllib2.Request(randNumberUrl,data,headers)
picture=opener.open(request).read()
local=open('D:/tmp.png','wb')
local.write(picture)
local.close()
原文地址:https://www.cnblogs.com/superxuezhazha/p/6423514.html