OSError:无法识别图像文件< _io.BytesIO对象0x000001C4EA23AE08>

时间:2018-04-30 04:54:38

标签: python scrapy-pipeline

当我使用scrapy.pipelines.images.ImagesPipeline下载图片时,我收到错误;

错误代码返回

  Traceback (most recent call last):
  File "C:\Users\\AppData\Local\Programs\Python\Python36\lib\site-packages\scrapy\pipelines\files.py", line 401, in media_downloaded
    checksum = self.file_downloaded(response, request, info)
  File "C:\Users\\AppData\Local\Programs\Python\Python36\lib\site-packages\scrapy\pipelines\images.py", line 101, in file_downloaded
    return self.image_downloaded(response, request, info)
  File "C:\Users\\AppData\Local\Programs\Python\Python36\lib\site-packages\scrapy\pipelines\images.py", line 105, in image_downloaded
    for path, image, buf in self.get_images(response, request, info):
  File "C:\Users\\AppData\Local\Programs\Python\Python36\lib\site-packages\scrapy\pipelines\images.py", line 118, in get_images
    orig_image = Image.open(BytesIO(response.body))
  File "C:\Users\\AppData\Local\Programs\Python\Python36\lib\site-packages\PIL\Image.py", line 2590, in open
    % (filename if filename else fp))
OSError: cannot identify image file <_io.BytesIO object at 0x0000014A3DC90728>
这是什么意思?

0 个答案:

没有答案