新手,不知道怎么解决
>>> i=0
>>> for url in listurl:
f=open('E:/python/mi/'+str(i)+'.jpg','wb')
req=urllib2.urlopen(url)
buf=req.read()
f.write(buf)
i+=1
Traceback (most recent call last):
File "<pyshell#14>", line 3, in <module>
req=urllib2.urlopen(url)
File "C:\Program Files\IBM\SPSS\Statistics\22\Python\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Program Files\IBM\SPSS\Statistics\22\Python\lib\urllib2.py", line 384, in open
protocol = req.get_type()
File "C:\Program Files\IBM\SPSS\Statistics\22\Python\lib\urllib2.py", line 245, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: src="//c1.mifile.cn/f/i/2014/cn/placeholder-220!110x110.png" data-src="//c1.mifile.cn/f/i/g/2015/xiaomiNOTE2-320-220!160x110.jpg" srcset="//c1.mifile.cn/f/i/g/2015/xiaomiNOTE2-320-220!320x220.jpg