错误代码示例:
def parse(self, response):
for news in response.xpath('//*[@class="Q-tpList"]/div/div/em').extract():
title = news.xpath('a/text()').extract()[0].strip()
解决方法:
把第二行xpath的.extract()删掉
错误代码示例:
def parse(self, response):
for news in response.xpath('//*[@class="Q-tpList"]/div/div/em').extract():
title = news.xpath('a/text()').extract()[0].strip()
解决方法:
把第二行xpath的.extract()删掉