Scrapy: AttributeError: 'list' object has no attribute 'iteritems' Scrapy: AttributeError: 'list' object has no attribute 'iteritems' python python

Scrapy: AttributeError: 'list' object has no attribute 'iteritems'


This is caused by the linked-in scraper's settings:

ITEM_PIPELINES = ['linkedIn.pipelines.LinkedinPipeline']

However, ITEM_PIPELINES is supposed to be a dict, according to the doc:

To activate an Item Pipeline component you must add its class to the ITEM_PIPELINES setting, like in the following example:

ITEM_PIPELINES = {    'myproject.pipelines.PricePipeline': 300,    'myproject.pipelines.JsonWriterPipeline': 800,}

The integer values you assign to classes in this setting determine the order in which they run: items go through from lower valued to higher valued classes. It’s customary to define these numbers in the 0-1000 range.

According to this question, it used to be a list, which explains why this scraper uses a list.So you will have to either ask your the developer of the scraper to update their code, or to set ITEM_PIPELINES yourself.


The short answer is the ITEM_PIPELINES should be a dictionary not a list with the key as the pipeline class and value an integer that determines the order in which they run: items go through from lower valued to higher valued classes. It’s customary to define these numbers in the 0-1000 range. as explained by @valentin Lorentz