Append sibling node only when it doesn't already exist

pull/21/head
Mišo Belica 11 years ago
parent 3746ee5bb5
commit 09b4040578

@ -2,6 +2,7 @@
Changelog for readability
==========================
- Sibling node is appended only when sibling doesn't already exist.
- Treat images a little differently so they get more inclusion.
- Added User-Agent string into HTTP requests.
- Added property ``Article.main_text`` for getting text annotated with

@ -154,7 +154,8 @@ def check_siblings(candidate_node, candidate_list):
# filtered out later by accident.
sibling.tag = "div"
candidate_node.node.append(sibling)
if candidate_node.node != sibling:
candidate_node.node.append(sibling)
return candidate_node

Loading…
Cancel
Save