python鼠标模拟实现中遇到的find_element_by_* commands are deprecated. Please use find_element() instead?如何解决
这是系统给的警告提示:find_element_by_* 的一系列命令已经被弃用。请使用 find_element() 代替
1、首先需要导入By包
from selenium.webdriver.common.by import By
2、用 find_element() 代替 find_element_by_*
# driver.find_element_by_name("NAME")
driver.find_element(By.NAME, "NAME")
# driver.find_element_by_class_name("CLASS_NAME")
driver.find_element(By.CLASS_NAME, "CLASS_NAME")
# driver.find_element_by_id("ID")
driver.find_element(By.ID, "ID")
# driver.find_element_by_xpath("XPATH")
driver.find_element(By.XPATH, "XPATH")
具体示例待续。