diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-07 18:01:06 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-07 18:01:06 -0500 |
commit | b32c88cc0362030f2801690aca695cf5d3d57f55 (patch) | |
tree | 178e61a52eb0c2c295dc78a6a0bf6ca681a38eff /bs4/__init__.py | |
parent | f23376fdeee206cbf24d4b3aff43a307fb3786a6 (diff) |
Added and tested insert_before and insert_after.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r-- | bs4/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py index 21e5d6c..58f2960 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -197,6 +197,12 @@ class BeautifulSoup(Tag): """Create a new tag associated with this soup.""" return Tag(None, None, name, attrs) + def new_string(self, s): + """Create a new NavigableString associated with this soup.""" + navigable = NavigableString(s) + navigable.setup() + return navigable + def popTag(self): tag = self.tagStack.pop() #print "Pop", tag.name |