AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'
时间: 2023-10-27 10:55:12 浏览: 126
webdriver不能启动浏览器,报module ‘selenium.webdriver’ has no attribute”问题解决办法
5星 · 资源好评率100%
This error occurs when you try to use the method `find_element_by_xpath()` on a `WebDriver` object, but the method is not defined for that object.
To fix this error, make sure you are using the correct object to call the method. For example, if you have created a `WebDriver` object called `driver`, you should use `driver.find_element_by_xpath()` instead of just `find_element_by_xpath()`.
Make sure you have imported the required modules, and that the syntax for the method call is correct. If you are still having issues, try searching for solutions online or consulting the documentation for the relevant module.
阅读全文