[英]Warning while using selenium with python
使用 selenium 在 html 中查找标签或类时,我收到以下警告:
<ipython-input-6-f7f8e8a9bbfc>:32: DeprecationWarning: find_elements_by_* commands are deprecated. Please use find_elements() instead
divTag = driver.find_elements_by_class_name('quote')
但是 find_elements() 也不起作用:
InvalidArgumentException: Message: invalid argument: invalid locator
(Session info: chrome=95.0.4638.69)
Stacktrace:
Backtrace:
有人可以帮我删除警告吗?
代替
divTag = driver.find_elements_by_class_name('quote')
尝试使用
divTag = driver.find_elements(By.CLASS_NAME,'quote')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.