Better cleanup of generic articles and lefigaro

try_drop_tree() was only removing the first result.
closes #725
This commit is contained in:
Laurent Bachelier 2012-02-01 01:10:26 +01:00
commit 57ce35cef1
3 changed files with 47 additions and 6 deletions

View file

@ -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: