Jithin
Jithin

Reputation: 1712

Scrapinghub exporting multiple items

In scrapinghub how can we achieve multiple items exporting?

I have MainItem() and a SubItem() item classes and I would like to get two separate items in scrapinghub item's page.

I can do this by implementing different item pipelines for both items in a normal crawling but how this can be achieved in scrapinghub? As of now, I'm getting only MainItem() objects in items page.

sample code snippet given below,

def parse_data(self, response):
    .
    .
    .
    # main item fields
    m_item = MainItem()
    m_item['a'] = 'A'
    m_item['b'] = 'B'
    yield m_item

    # sub item fields
    s_item = SubItem()
    s_item['c'] = 'C'
    s_item['d'] = 'D'
    yield s_item

Here in scrapinghub I'm able to view only MainItems() fields

Upvotes: 0

Views: 146

Answers (1)

Marcos
Marcos

Reputation: 675

Can you provide more information? The spider code and logs, I can't see any problem with your example.

Scrapy Cloud does allow a spider to yield different items. These items can be filtered later using the SC interface.

Upvotes: 1

Related Questions