def parse(self, response):
selector = Selector(response)
books = selector.xpath('//div[@class="info"]/h2/a/@href').extract()
for book in books:
print book
yield Request(book, callback=self.parse_item)
nextPage = selector.xpath('//span[@class="next"]/a/@href').extract()
if nextPage:
print nextPage[0]
yield Request(self.url+nextPage[0],callback=self.parse)
评论列表
文章目录