The By implementation.
Classes
By
()
Set of supported locator strategies.
Set of supported locator strategies.
ID: – Select the element by its ID.
>>> element = driver.find_element(By.ID, "myElement")XPATH:¶
absolute path
relative path
>>> element = driver.find_element(By.XPATH, "//html/body/div")LINK_TEXT:¶
Select the link element having the exact text.
>>> element = driver.find_element(By.LINK_TEXT, "myLink")PARTIAL_LINK_TEXT:¶
Select the link element having the partial text.
>>> element = driver.find_element(By.PARTIAL_LINK_TEXT, "my")NAME:¶
Select the element by its name attribute.
>>> element = driver.find_element(By.NAME, "myElement")TAG_NAME:¶
Select the element by its tag name.
>>> element = driver.find_element(By.TAG_NAME, "div")CLASS_NAME:¶
Select the element by its class name.
>>> element = driver.find_element(By.CLASS_NAME, "myElement")CSS_SELECTOR:¶
Select the element by its CSS selector.
>>> element = driver.find_element(By.CSS_SELECTOR, "div.myElement")
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4