get_attribute
The command to get the attribute's value with the given name.
Last updated
The command to get the attribute's value with the given name.
Element.get_attribute(attribute: str) -> bool | str | Nonepy.get("a").get_attribute("href")
---or--- # store in a variable
href = py.get("a").get_attribute("href")
assert href.startswith("https://")attribute (str) = The name of the attribute to find in the Element
If the value is "true" or "false", then this returns a bool of True or False
If the name does not exist, return None
All other values are returned as strings
Last updated