def getpagenum(self,response):
try:
self.driver.find_element_by_tag_name("body").send_keys(Keys.END)
self.driver.find_element_by_xpath("//li[@id='commentTab']/a").click()
time.sleep(3)
# ????
comments = response.xpath("//li[@id='commentTab']/a/text()").extract()[0]
commentnum = re.sub('\D','',comments)
commentpagenum = int(commentnum)/15+1
self.crawlcommentinfo(commentpagenum)
except:
pass
# ????????
评论列表
文章目录