今天重装系统后,原来的selenium运行不了了,报错’NoneType’ object has no attribute ‘find_element_by_xpath’
查了相关文献,发现是因为selenium 4.0以后弃用了find_element_by_xpath方法,可用find_element代替:
```python
driver.find_element("id","pan")
#导入模块
from selenium.webdriver.common.by import By
driver.find_element(By.ID,"username")
driver.find_element(By.CLASS_NAME,"password")
driver.find_element(By.TAG_NAME,"imput")
usename_input = driver.find_element('xpath','//*[@id="app"]/input')