summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py6
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