Selenium positioning method
Selenium's webdriver provides eight basic element positioning methods, the first six are directly located through the attributes of the element, and the latter two need to be located with the help of the firepath plug-in:
1. Locate through id: find_element_by_id ()
Eg:driver.find_element_by_id ("kw") .send_keys ("python")
two。 Locate through name: find_element_by_name ()
3. Locate through class: find_element_by_class_name ()
4. Locate through tag: find_element_by_tag_name ()
5. Locate through link: find_element_by_link_text ()
6. Locate through partial_link: find_element_by_partial_link_text ()
7. Locate through xpath: find_element_by_xpath ()
8. Locate through css: find_element_by_css_selector ()