def GetTotalPage(self, html):
# create the BeautifulSoup
some_soup = BeautifulSoup(html)
#get the page div
ele_a = some_soup.find('div', attrs={'class': 'page'})
#get the last div>a text='??'
last_a = ele_a.findAll('a')[-1]
#substr 0:.html
pagenum = last_a.get('href')[:-5]
print 'pagenum :', pagenum
# print type(last_a)
self.SaveTotalPageToFile(pagenum)
# store the max page number to totalpage.ini
#new_page_num: new max page num
评论列表
文章目录