DeprecationWarning: find_element_by_css_selector is deprecated. Please use find_element(by=By.CSS_SELECTOR, value=css_selector) instead
时间: 2023-11-27 12:06:09 浏览: 86
解决 warning 显示 The linear_assignment function is deprecated in 0.21 and will be removed from 0.23. Us…
这个警告是因为 `find_element_by_css_selector` 方法已经过时了,建议使用 `find_element` 方法。你可以这样修改代码:
```python
from selenium.webdriver.common.by import By
element = driver.find_element(By.CSS_SELECTOR, 'your_css_selector')
```
阅读全文