summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-16 16:33:40 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-16 16:33:40 -0500
commite1b321db7331752a3aea8dd7070dd0db4c60c51d (patch)
tree96ce9539fb1e0dbb1dc8b4f264737159e9a2cd1d /bs4/__init__.py
parent1a50d9623831990ae0a78ea3a7e66fa098fe92ac (diff)
It's a start, at least.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 98ac57b..786b57b 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -193,9 +193,9 @@ class BeautifulSoup(Tag):
self.tagStack = []
self.pushTag(self)
- def new_tag(self, name, **attrs):
+ def new_tag(self, name, namespace=None, **attrs):
"""Create a new tag associated with this soup."""
- return Tag(None, self.builder, name, attrs)
+ return Tag(None, self.builder, name, namespace, attrs)
def new_string(self, s):
"""Create a new NavigableString associated with this soup."""
@@ -272,7 +272,7 @@ class BeautifulSoup(Tag):
mostRecentTag = self.popTag()
return mostRecentTag
- def handle_starttag(self, name, attrs):
+ def handle_starttag(self, name, namespace, attrs):
"""Push a start tag on to the stack.
If this method returns None, the tag was rejected by the
@@ -289,7 +289,7 @@ class BeautifulSoup(Tag):
or not self.parse_only.search_tag(name, attrs))):
return None
- tag = Tag(self, self.builder, name, attrs, self.currentTag,
+ tag = Tag(self, self.builder, name, namespace, attrs, self.currentTag,
self.previous_element)
if tag is None:
return tag