Почему я не могу перейти на следующую страницу в parse_next и объединить некоторую дату и объект?
def parse(self, response):
item = TItem()
...
link_www = lekarz.xpath('whatever/@href').extract_first()
request = scrapy.Request(link_www, callback=self.parse_next)
request.meta['item'] = item
yield request
next_page = response.css('whenever::attr(href)').extract_first()
if next_page is not None:
yield response.follow(next_page, callback=self.parse)
attri = []
def parse_next(self, response):
item = response.meta['item']
self.attri.append(xpath("whatever")).extract_first
next_pager = response.css('whatever_too_xd').extract_first()
if next_pager is not None:
yield response.follow(next_pager, callback=self.parse_next)
else:
item['hehe'] = self.attri
yield item
ВЫХОД:
KeyError: 'item'
Почему