summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-08 13:06:25 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-08 13:06:25 -0400
commit65ed51cb89cac416c2adb9a88626f85ab5b8d331 (patch)
treeb05f61d7b9a7b63bc9c1adf8464b68cbe2726547 /doc/source
parent74a499a033623a164ca2756065fdcc9348b7382c (diff)
Updated docs with new examples.
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/index.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst
index c106f00..f44f896 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1651,6 +1651,15 @@ Find tags `directly` beneath other tags::
soup.select("body > a")
# []
+Find the siblings of tags::
+
+ soup.select("#link1 ~ .sister")
+ # [<a class="sister" href="http://example.com/lacie" id="link2">Lacie</a>,
+ # <a class="sister" href="http://example.com/tillie" id="link3">Tillie</a>]
+
+ soup.select("#link1 + .sister")
+ # [<a class="sister" href="http://example.com/lacie" id="link2">Lacie</a>]
+
Find tags by CSS class::
soup.select(".sister")