summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/index.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 654a3a4..cd1ab2f 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1262,6 +1262,16 @@ dictionary and passing the dictionary into ``find_all()`` as the
data_soup.find_all(attrs={"data-foo": "value"})
# [<div data-foo="value">foo!</div>]
+Similarly for HTML's 'name' attribute, which you can't use as a
+keyword argument because Beautiful Soup uses the ``name`` argument to
+contain the name of the tag itself.
+
+ name_soup = BeautifulSoup('<input name="email"/>')
+ name_soup.find_all(name="email")
+ # []
+ name_soup.find_all(attrs={"name": "email"})
+ # [<input name="email"/>]
+
.. _attrs:
Searching by CSS class