没问题。以下是您的代码的正确版本:
def page_parser(self, response): sites = hxs.select('//div[@]') items = [] request = Request("http://www.example.com/lin1.cpp", callback=self.parseDescription1) request.meta['item'] = item yield request request = Request("http://www.example.com/lin1.cpp", callback=self.parseDescription2, meta={'item': item}) yield request yield Request("http://www.example.com/lin1.cpp", callback=self.parseDescription3, meta={'item': item})def parseDescription1(self,response): item = response.meta['item'] item['desc1'] = "test" return itemdef parseDescription2(self,response): item = response.meta['item'] item['desc2'] = "test2" return itemdef parseDescription3(self,response): item = response.meta['item'] item['desc3'] = "test3" return item
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)