siblings

The command to get the siblings of the current element.

Syntax

Element.siblings() -> Elements

Usage

correct usage
py.get("a").siblings()

---or--- # store in a variable

elements = py.get(".nav-link").siblings()

---or--- # chain an Elements command

sibling = py.get("ul").siblings().first()

Arguments

  • None

Yields

  • Elements - A list of Elements. The list is empty if no siblings are found.

Last updated