diff options
Diffstat (limited to 'bs4/element.py')
-rw-r--r-- | bs4/element.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bs4/element.py b/bs4/element.py index 130dfa9..370b153 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -457,6 +457,11 @@ class PageElement(object): :param tags: A list of PageElements. """ + if isinstance(tags, Tag): + # Calling self.append() on another tag's contents will change + # the list we're iterating over. Make a list that won't + # change. + tags = list(tags.contents) for tag in tags: self.append(tag) |