我有这个
def parse(self, response):
sel = Selector(response)
sites = sel.xpath('myXpath')
for site in sites:
Date = site.css('p[class=date]::text').extract()
yield Request(Link, callback = self.parseOneCar)
def parseOneCar(self, response):
sel = Selector(response)
Do somethings
我想将Date
发送给第二个蜘蛛。
怎么样?
答案 0 :(得分:2)
def parse(self, response):
...
yield Request(Link,
meta={'date': Date},
callback = self.parseOneCar)
def parseOneCar(self, response):
...
Date = response.meta['date']
了解更多信息see the docs