mirror of
https://github.com/wassname/FanFicFare.git
synced 2026-09-11 11:52:07 +08:00
Google Books don't like the garbeled HTML comments that could come from
hpfanficarchive, removing all comments
This commit is contained in:
@@ -217,8 +217,13 @@ class HPFanficArchiveComAdapter(BaseSiteAdapter):
|
||||
selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags.
|
||||
|
||||
div = soup.find('div', {'id' : 'story'})
|
||||
|
||||
|
||||
if None == div:
|
||||
raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url)
|
||||
|
||||
return self.utf8FromSoup(url,div)
|
||||
|
||||
# Comments can get garbled later in the process, preventing inport into some readers (specifically seen on Google Books)
|
||||
# This will remove all html comemnts from the text body.
|
||||
body = self.utf8FromSoup(url,div)
|
||||
body = re.sub(r'<!--.+?-->', r'', body)
|
||||
|
||||
return body
|
||||
|
||||
Reference in New Issue
Block a user