mirror of
https://github.com/kemayo/leech
synced 2026-01-04 14:43:48 +01:00
FFN: less-destructive attribute clearing
This commit is contained in:
parent
6cc1620fb3
commit
dc10e4cf17
1 changed files with 3 additions and 1 deletions
|
|
@ -70,12 +70,14 @@ class FanFictionNet(Site):
|
|||
raise SiteException("No chapter content")
|
||||
|
||||
text = content.find(id="storytext")
|
||||
if not text:
|
||||
raise SiteException("No chapter content")
|
||||
|
||||
# clean up some invalid xhtml attributes
|
||||
# TODO: be more selective about this somehow
|
||||
try:
|
||||
for tag in text.find_all(True):
|
||||
tag.attrs = None
|
||||
tag.attrs.clear()
|
||||
except Exception:
|
||||
logger.exception("Trouble cleaning attributes")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue