find
The command to get a list of Elements that match the CSS selector.
Syntax
py.find(css: str) -> Elements
py.find(css: str, timeout: int) -> Elements
---or---
Element.find(css: str) -> Elements
Element.find(css: str, timeout: int) -> ElementsUsage
# Yield Elements in .nav with tag name of a
py.get(".nav").find("a")
---or---
# Yield all Elements in the DOM with id of 'button'
py.find("#button")
---or--- # store in a variable
elements = py.find("li")
---or--- # chain an Elements command
element = py.find("ul > li").first()
---or--- # control the timeout in any of the above usages
py.find("li", timeout=5).last()Arguments
Yields
Examples
Last updated