mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-01-03 06:34:04 +01:00
Change td in portkey chapter text to div for nook.
This commit is contained in:
parent
b7a3f327b0
commit
df3655a57c
1 changed files with 5 additions and 4 deletions
|
|
@ -258,9 +258,10 @@ class PortkeyOrgAdapter(BaseSiteAdapter): # XXX
|
|||
selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags.
|
||||
|
||||
#print("soup:%s"%soup)
|
||||
td = soup.find('td', {'class' : 'story'})
|
||||
tag = soup.find('td', {'class' : 'story'})
|
||||
tag.name='div' # force to be a div to avoid problems with nook.
|
||||
|
||||
centers = td.findAll('center')
|
||||
centers = tag.findAll('center')
|
||||
# first two and last two center tags are some script, 'report
|
||||
# story', 'report story' and an ad.
|
||||
centers[0].extract()
|
||||
|
|
@ -268,7 +269,7 @@ class PortkeyOrgAdapter(BaseSiteAdapter): # XXX
|
|||
centers[-1].extract()
|
||||
centers[-2].extract()
|
||||
|
||||
if None == td:
|
||||
if None == tag:
|
||||
raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url)
|
||||
|
||||
return self.utf8FromSoup(url,td)
|
||||
return self.utf8FromSoup(url,tag)
|
||||
|
|
|
|||
Loading…
Reference in a new issue