From 1cd5ad49b15d17fac017543876ec5d0a67b57b69 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Tue, 7 May 2013 10:58:27 -0400 Subject: Added support for the "nth-of-type" CSS selector. The CSS selector ">" can now find a tag by means other than the tag name. Code by Sven Slootweg. --- doc/source/index.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/source') diff --git a/doc/source/index.rst b/doc/source/index.rst index bfaa4d5..03d4824 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1613,6 +1613,9 @@ You can find tags:: soup.select("title") # [The Dormouse's story] + soup.select("p nth-of-type(3)") + # [

...

] + Find tags beneath other tags:: soup.select("body a") @@ -1633,6 +1636,12 @@ Find tags `directly` beneath other tags:: # Lacie, # Tillie] + soup.select("p > a:nth-of-type(2)") + # [Lacie] + + soup.select("p > #link1") + # [Elsie] + soup.select("body > a") # [] -- cgit v1.2.3