By positioning
Using Selenium’s BY positioning, you first need to import the module
from selenium.webdriver.common.by import By
id attribute locates find_element(By.ID, "id")
name attribute locate find_element(By.NAME, "name")
classname attribute locate find_element(By.CLASS_NAME, "claname")
a tag text attribute locationfind_element(By.LINK_TEXT, "text")
a tag partial text attribute locationfind_element(By.PARTIAL_LINK_TEXT, "partailtext")
tag_name locate-find_elemnt(By.TAG_NAME, "input")
xpath path positioning-find_element(By.XPATH,"//div[@name='name']")
css selector positioningfind_element(By.CSS_SELECTOR, "#id")
Read More:
- Several ways to center elements horizontally and vertically
- valueError: Length mismatch: Expected axis has 40 elements, new values have 38 elements
- CSS: several ways to center the box vertically and horizontally
- Solutions to the problem of unable to locate package
- Unable to locate executable for jre1.8.0_261
- Linux novice: unable to locate package error solution
- Several ways to view spark task log
- Solution of selenium driven edge error reporting
- Unknown error: cannot find chrome binary when running selenium under Linux
- E: unable to locate package MySQL server error solution
- Python uses the priority queue to get the maximum k elements
- Python + selenium drop-down list error message: element not interactive
- Four ways to get Django parameters in request
- Several ways to check the IP address of raspberry pie
- Three ways to get form data in struct2
- Selenium driver chrome failed to start and reported an error
- Learn English together | three ways to realize digital factorial with JavaScript
- After BS4, select was used to locate
- JQuery is a solution to the disappearance of listening events after adding elements with append
- RuntimeError: Unable to locate turbojpeg library automatically. You may specify the turbojpeg librar