summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-21 12:19:56 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-21 12:19:56 -0500
commit2ccae07967bb15f6bad6ba262411ac47bcbb98e7 (patch)
tree210416dd1fec859500ff4e23e6fced41f1b5e4f9 /bs4/__init__.py
parentfc625b23c7e17b55aee18c8d449c14c13702b937 (diff)
Added nsprefix argument to the tag class.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 647a815..7007796 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, namespace=None, **attrs):
+ def new_tag(self, name, namespace=None, nsprefix=None, **attrs):
"""Create a new tag associated with this soup."""
- return Tag(None, self.builder, name, namespace, attrs)
+ return Tag(None, self.builder, name, namespace, nsprefix, 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, namespace, attrs):
+ def handle_starttag(self, name, namespace, nsprefix, attrs):
"""Push a start tag on to the stack.
If this method returns None, the tag was rejected by the
@@ -289,8 +289,8 @@ class BeautifulSoup(Tag):
or not self.parse_only.search_tag(name, attrs))):
return None
- tag = Tag(self, self.builder, name, namespace, attrs, self.currentTag,
- self.previous_element)
+ tag = Tag(self, self.builder, name, namespace, nsprefix, attrs,
+ self.currentTag, self.previous_element)
if tag is None:
return tag
if self.previous_element: