By类定位介绍
导入By类 :from selenium.webdriver.common.by import By
方法:
find_element(By.ID, "kw")
find_element(By.NAME, "kw")
find_element(By.XPATH, "kw")
find_element(By.CLASS_NAME, "kw")
find_element(By.LINK_TEXT, "kw")
find_element(By.CSS_SELECTOR, "kw")
JavaScript定位介绍
方法:
document.getElementsByClassName()
document.getElementsByName()
document.getElementsByTagName()