first
The command to get the first Element in a list of Elements.
Last updated
The command to get the first Element in a list of Elements.
Elements.first() -> Elementpy.find("li").first()
---or--- # store in a variable
element = py.xpath("//a").first()
---or--- # chain an Element command
py.get("ul > li").children().first().click()# Errors, 'get' yields Element, not Elements
py.get("ul > li").first()None
Element - The first Element in the list of Elements
IndexError if Elements is empty
Last updated