I wanted to know from where do I access an item or where is it returned when I yield an item in parse function ? See the sample code below
from scrapy import Spider
from scrapy import Selector
import scrapy
from scrapy.item import Item,Field
class StackItem(Item):
title = Field()
url = Field()
class StackSpider(Spider):
name = "stack"
allowed_domains = ["stackoverflow.com"]
start_urls = [
"http://stackoverflow.com/questions?pagesize=50&sort=newest"
]
def parse(self, response):
questions = Selector(response).xpath('//*[@class="summary"]/h3')
for question in questions:
item = StackItem()
item['title'] = question.xpath(
'a[@class="question-hyperlink"]/text()').extract()
item['url'] = question.xpath(
'a[@class="question-hyperlink"]/@href').extract()
yield item
I am confused that where is this item returned back to ? And how do I access it later on ? Any help would be appreciated. Thanks