mirror of
https://git.launchpad.net/beautifulsoup
synced 2025-10-06 00:12:49 +02:00
Fixed syntax errors in documentation.
This commit is contained in:
@@ -27,6 +27,8 @@ Python 2 was revision 70f546b1e689a70e2f103795efce6d261a3dadf7.
|
||||
select() and select_one() methods; they have not been deprecated,
|
||||
but they have been demoted to convenience methods.
|
||||
|
||||
[bug=2003677]
|
||||
|
||||
= 4.11.2 (20230131)
|
||||
|
||||
* Fixed test failures caused by nondeterministic behavior of
|
||||
|
@@ -1673,8 +1673,8 @@ that show up earlier in the document than the one we started with. A
|
||||
<p> tag that contains an <a> tag must have shown up before the <a>
|
||||
tag it contains.
|
||||
|
||||
The ``.css`` property and CSS selectors
|
||||
---------------------------------------
|
||||
CSS selectors through the ``.css`` property
|
||||
-------------------------------------------
|
||||
|
||||
``BeautifulSoup`` and ``Tag`` objects support CSS selectors through
|
||||
their ``.css`` property. The actual selector implementation is handled
|
||||
@@ -1683,10 +1683,9 @@ package, available on PyPI as ``soupsieve``. If you installed
|
||||
Beautiful Soup through ``pip``, Soup Sieve was installed at the same
|
||||
time, so you don't have to do anything extra.
|
||||
|
||||
`The Soup Sieve documentation
|
||||
<https://facelessuser.github.io/soupsieve/>`_ lists all the currently
|
||||
supported CSS selectors, but here are some of the basics. You can find
|
||||
tags::
|
||||
The Soup Sieve documentation lists `all the currently supported CSS
|
||||
selectors <https://facelessuser.github.io/soupsieve/selectors/>`_, but
|
||||
here are some of the basics. You can find tags::
|
||||
|
||||
soup.css.select("title")
|
||||
# [<title>The Dormouse's story</title>]
|
||||
@@ -1788,7 +1787,8 @@ first tag that matches a selector::
|
||||
# <a class="sister" href="http://example.com/elsie" id="link1">Elsie</a>
|
||||
|
||||
As a convenience, you can call ``select()`` and ``select_one()`` can
|
||||
directly on the ``BeautifulSoup`` or ``Tag`` object::
|
||||
directly on the ``BeautifulSoup`` or ``Tag`` object, omitting the
|
||||
``.css`` property::
|
||||
|
||||
soup.select('a[href$="tillie"]')
|
||||
# [<a class="sister" href="http://example.com/tillie" id="link3">Tillie</a>]
|
||||
@@ -1814,7 +1814,7 @@ documentation <https://facelessuser.github.io/soupsieve/>`_ for full
|
||||
documentation.
|
||||
|
||||
The ``iselect()`` method works the same as ``select()``, but it
|
||||
returns a generator instead of a list.
|
||||
returns a generator instead of a list::
|
||||
|
||||
[tag['id'] for tag in soup.css.iselect(".sister")]
|
||||
# ['link1', 'link2', 'link3']
|
||||
@@ -1882,7 +1882,7 @@ your own dictionary of abbreviations::
|
||||
History of CSS selector support
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The `.css` property was added in Beautiful Soup 4.12.0. Prior to this,
|
||||
The ``.css`` property was added in Beautiful Soup 4.12.0. Prior to this,
|
||||
only the ``.select()`` and ``.select_one()`` convenience methods were
|
||||
supported.
|
||||
|
||||
|
Reference in New Issue
Block a user