Better cleanup of generic articles and lefigaro
try_drop_tree() was only removing the first result. closes #725
This commit is contained in:
parent
b7f3d9cd82
commit
57ce35cef1
3 changed files with 47 additions and 6 deletions
|
|
@ -30,10 +30,8 @@ def try_remove(parser, base_element, selector):
|
|||
|
||||
|
||||
def try_drop_tree(parser, base_element, selector):
|
||||
try:
|
||||
parser.select(base_element, selector, 1).drop_tree()
|
||||
except BrokenPageError:
|
||||
pass
|
||||
for el in parser.select(base_element, selector):
|
||||
el.drop_tree()
|
||||
|
||||
def remove_from_selector_list(parser, base_element, selector_list):
|
||||
for selector in selector_list:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue