From d6e8f7a6f52685f22562a285ea23ada6819bb685 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 19 Dec 2016 17:45:07 -0500 Subject: Documentation fixes. [bug=1651050] --- doc/source/index.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/source') diff --git a/doc/source/index.rst b/doc/source/index.rst index cd1ab2f..56aa7fe 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1050,7 +1050,7 @@ A regular expression ^^^^^^^^^^^^^^^^^^^^ If you pass in a regular expression object, Beautiful Soup will filter -against that regular expression using its ``match()`` method. This code +against that regular expression using its ``search()`` method. This code finds all the tags whose names start with the letter "b"; in this case, the tag and the tag:: @@ -1262,9 +1262,10 @@ dictionary and passing the dictionary into ``find_all()`` as the data_soup.find_all(attrs={"data-foo": "value"}) # [
foo!
] -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. +You can't use a keyword argument to search for HTML's 'name' element, +because Beautiful Soup uses the ``name`` argument to contain the name +of the tag itself. Instead, you can give a value to 'name' in the +``attrs`` argument. name_soup = BeautifulSoup('') name_soup.find_all(name="email") -- cgit v1.2.3