diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-01 11:24:28 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-01 11:24:28 -0500 |
commit | 713817f97c12a0eaa331eadef2277f058159aebd (patch) | |
tree | 9294bad0c0a9ab4744888a8e9535ee736f557518 /bs4/__init__.py | |
parent | 342fbb95061e21cfda550f41b4faef7e3d569077 (diff) |
Added tag creation and string generators, both created while writing the docs.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r-- | bs4/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py index 07795b9..fbe2914 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -193,6 +193,10 @@ class BeautifulSoup(Tag): self.tagStack = [] self.pushTag(self) + def new_tag(self, name, **attrs): + """Create a new tag associated with this soup.""" + return Tag(None, None, name, attrs) + def popTag(self): tag = self.tagStack.pop() #print "Pop", tag.name |