summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
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")