Code:
def append_page(self, soup, appendtag, position):
pager = soup.find('div', attrs={'class':'text-c'})
if pager:
nextpage = soup.find('a', attrs={'class':'a1'})
if nextpage:
nexturl = nextpage['href']
soup2 = self.index_to_soup(nexturl)
texttag = soup2.find('div', attrs={'class':'content_left_5'})
for it in texttag.findAll(style=True):
del it['style']
newpos = len(texttag.contents)
self.append_page(soup2,texttag,newpos)
texttag.extract()
pager.extract()
appendtag.insert(position,texttag)
I wonder if it works?