summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS.txt18
-rw-r--r--bs4/element.py2
-rw-r--r--bs4/tests/test_tree.py5
3 files changed, 18 insertions, 7 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 1b8b252..d9b421e 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,14 +1,20 @@
-= 4.0.0b10 () =
+= 4.0.0b10 (20120302) =
* Added support for simple CSS selectors, taken from the soupselect project.
+* Fixed a crash when using html5lib. [bug=943246]
+
* In HTML5-style <meta charset="foo"> tags, the value of the "charset"
- attribute is now replaced with the appropriate encoding on output.
+ attribute is now replaced with the appropriate encoding on
+ output. [bug=942714]
+
+* Fixed a bug that caused calling a tag to sometimes call find_all()
+ with the wrong arguments. [bug=944426]
* For backwards compatibility, brought back the BeautifulStoneSoup
class as a deprecated wrapper around BeautifulSoup.
-= 4.0.0b9 (20110228) =
+= 4.0.0b9 (20120228) =
* Fixed the string representation of DOCTYPEs that have both a public
ID and a system ID.
@@ -24,7 +30,7 @@
* Made prettify() return Unicode by default, so it will look nice on
Python 3 when passed into print().
-= 4.0.0b8 (20110224) =
+= 4.0.0b8 (20120224) =
* All tree builders now preserve namespace information in the
documents they parse. If you use the html5lib parser or lxml's XML
@@ -41,7 +47,7 @@
conjunction with the html5lib tree builder, which doesn't support
them.
-= 4.0.0b7 (20110223) =
+= 4.0.0b7 (20120223) =
* Upon decoding to string, any characters that can't be represented in
your chosen encoding will be converted into numeric XML entity
@@ -70,7 +76,7 @@
This makes Beautiful Soup compatible with html5lib version 0.95 and
future versions of HTMLParser.
-= 4.0.0b6 (20110216) =
+= 4.0.0b6 (20120216) =
* Multi-valued attributes like "class" always have a list of values,
even if there's only one value in the list.
diff --git a/bs4/element.py b/bs4/element.py
index 584e171..2851a75 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -838,7 +838,7 @@ class Tag(PageElement):
"""Calling a tag like a function is the same as calling its
find_all() method. Eg. tag('a') returns a list of all the A tags
found within this tag."""
- return self.find_all(args, kwargs)
+ return self.find_all(*args, **kwargs)
def __getattr__(self, tag):
#print "Getattr %s.%s" % (self.__class__, tag)
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index 3f32736..6d22448 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -99,6 +99,11 @@ class TestFindAll(TreeTest):
self.assertSelects(
soup.find_all('a', limit=0), ["1", "2", "3", "4", "5"])
+ def test_calling_a_tag_is_calling_findall(self):
+ soup = self.soup("<a>1</a><b>2<a id='foo'>3</a></b>")
+ self.assertSelects(soup('a', limit=1), ["1"])
+ self.assertSelects(soup.b(id="foo"), ["3"])
+
class TestFindAllBasicNamespaces(TreeTest):
def test_find_by_namespaced_name(self):