bickmark
bickmark

Reputation: 11

Scrapy item metadata?

My spider yields two types of items, which are then processed by a pipeline. Is there a way for the pipeline to identify each type of item (other than through the keys). Some sort of metadata type or title field?

Upvotes: 0

Views: 307

Answers (1)

gangabass
gangabass

Reputation: 10666

In your pipelines.py:

def process_item(self, item, spider):

    if isinstance(item, YourItemType1):
        # code to process Item Type 1

Upvotes: 1

Related Questions