我需要从这些网站上抓取一些网站和一些图片。当图像是 *.jpg 时,我没有任何问题,但这些网站也有 *.svg 图像,我需要这些。
有没有人这样做过?
这是带有错误的shell输出:
2013-01-18 14:44:10-0600 [crawler] DEBUG: Image (downloaded): Downloaded image from <GET http://page/image.svg> referred in <None>
2013-01-18 14:44:10-0600 [crawler] Unhandled Error
Traceback (most recent call last):
File "/virtualenvs/asd/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/virtualenvs/asd/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 381, in callback
self._startRunCallbacks(result)
File "/virtualenvs/asd/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
self._runCallbacks()
File "/virtualenvs/asd/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
current.result = callback(current.result, *args, **kw)
--- <exception caught here> ---
File "/virtualenvs/asd/local/lib/python2.7/site-packages/Scrapy-0.16.3-py2.7.egg/scrapy/contrib/pipeline/images.py", line 199, in media_downloaded
checksum = self.image_downloaded(response, request, info)
File "/virtualenvs/asd/local/lib/python2.7/site-packages/Scrapy-0.16.3-py2.7.egg/scrapy/contrib/pipeline/images.py", line 252, in image_downloaded
for key, image, buf in self.get_images(response, request, info):
File "/virtualenvs/asd/local/lib/python2.7/site-packages/Scrapy-0.16.3-py2.7.egg/scrapy/contrib/pipeline/images.py", line 261, in get_images
orig_image = Image.open(StringIO(response.body))
File "/virtualenvs/asd/local/lib/python2.7/site-packages/PIL/Image.py", line 1980, in open
raise IOError("cannot identify image file")
exceptions.IOError: cannot identify image file
谢谢 !(对不起我的英语不好)