def parse(self, response):
sel = scrapy.Selector(response)
#print(sel.xpath('//title').extract())
fligint_div = "//ul[@class='news-list2']/li[1]/div[@class='gzh-box2']/div[@class='img-box']/a[1]/@href"
first_url_list = sel.xpath(fligint_div).extract()
self.first_url = first_url_list[0]
print(self.first_url)
yield scrapy.Request(self.first_url,meta=self.meta, callback=self.parse_url_list)
评论列表
文章目录