我正在尝试使用我的搜寻器从instagram个人资料下载图像。
我尝试按照本教程https://docs.scrapy.org/en/latest/topics/media-pipeline.html#usage-example进行操作,但最终无法正常工作。我尝试像他们说的那样设置管道,但是我敢肯定我做错了(这是settings.py)'instagramscraper.pipelines.InstagramscraperPipeline': 300,
'scrapy.pipelines.images.ImagesPipeline': 1
class InstagramSpider(scrapy.Spider, scrapy.Item):
name = 'ig'
start_urls = [
'https://www.instagram.com/omi_in_a_hellcat/'
]
image_urls = scrapy.Field()
images = scrapy.Field()
def parse(self, response, images):
title = response.css('title').extract()
yield {'title': title,
'images': images}