mirror of
https://github.com/kemayo/leech
synced 2026-04-21 03:50:49 +02:00
Just full-on strip attributes
This commit is contained in:
parent
e434d9839c
commit
df13ee7b2a
1 changed files with 3 additions and 6 deletions
9
leech.py
9
leech.py
|
|
@ -79,12 +79,9 @@ def _extract_chapter(url, title):
|
||||||
text = content.find(id="storytext")
|
text = content.find(id="storytext")
|
||||||
|
|
||||||
# clean up some invalid xhtml attributes
|
# clean up some invalid xhtml attributes
|
||||||
# TODO: be more thorough about this somehow
|
# TODO: be more selective about this somehow
|
||||||
for tag in text.find_all('hr'):
|
for tag in text.find_all(True):
|
||||||
if 'size' in tag.attrs:
|
tag.attrs = None
|
||||||
del(tag.attrs['size'])
|
|
||||||
if 'noshade' in tag.attrs:
|
|
||||||
del(tag.attrs['noshade'])
|
|
||||||
|
|
||||||
return (title, text.prettify())
|
return (title, text.prettify())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue