From 91397340f4736b78c57c4b07cd11ef0587919200 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 8 Feb 2023 17:02:14 -0500 Subject: Fixed syntax errors in documentation. --- doc/source/index.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/source') diff --git a/doc/source/index.rst b/doc/source/index.rst index 5152929..f1be0c5 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1673,8 +1673,8 @@ that show up earlier in the document than the one we started with. A

tag that contains an tag must have shown up before the 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 -`_ 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 `_, but +here are some of the basics. You can find tags:: soup.css.select("title") # [The Dormouse's story] @@ -1788,7 +1787,8 @@ first tag that matches a selector:: # Elsie 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"]') # [Tillie] @@ -1814,7 +1814,7 @@ documentation `_ 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. -- cgit v1.2.3