在从link抓取图像时,我注意到图像的网址是这样的(数据:image / jpeg; base64,/ 9j / 4AAQSkZJRgABAQEAYABgAAD ......)。检查时,你&# 39;我将了解该链接,如果您看到该链接中不包含任何http或www部分。执行此代码后:
spider.py
img_url=response.xpath('//table/tbody/tr/td/span/a/img/@src').extract()
for urls in img_url:
yield {"image_urls":urls}
我收到错误:
ValueError: Missing scheme in request url: d
setting.py 看起来像这样
ITEM_PIPELINES = {'scrapy.pipelines.images.ImagesPipeline': 1}
IMAGES_STORE = 'C:\Users\Danial\Desktop\saab_pics\output'