diff options
author | Leonard Richardson <leonardr@segfault.org> | 2016-12-19 17:45:07 -0500 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2016-12-19 17:45:07 -0500 |
commit | d6e8f7a6f52685f22562a285ea23ada6819bb685 (patch) | |
tree | 39e12b9101470ba51e9611d0f4a5b76acb40aab4 /doc/source | |
parent | ad9e588d54561ed929e89b3433e75388e45366ae (diff) |
Documentation fixes. [bug=1651050]
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/index.rst | 9 |
1 files changed, 5 insertions, 4 deletions
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 <body> tag and the <b> tag:: @@ -1262,9 +1262,10 @@ 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. +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('<input name="email"/>') name_soup.find_all(name="email") |