diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2013-06-03 10:33:03 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2013-06-03 10:33:03 -0400 |
commit | 4cc522e01dae3fab54170060beef1389d528f6b6 (patch) | |
tree | 509368036b44969526becf745093fb7327676e02 /bs4/element.py | |
parent | aff6cac088db63a65415f2d239e9c8bf07001e73 (diff) |
Improved performance for html5lib.
Diffstat (limited to 'bs4/element.py')
-rw-r--r-- | bs4/element.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bs4/element.py b/bs4/element.py index 7b63b30..40b1631 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -258,7 +258,7 @@ class PageElement(object): def _last_descendant(self): "Finds the last element beneath this object to be parsed." last_child = self - while hasattr(last_child, 'contents') and last_child.contents: + while isinstance(last_child, Tag) and last_child.contents: last_child = last_child.contents[-1] return last_child # BS3: Not part of the API! |