AttributeError: module 'selenium.webdriver' has no attribute 'Chorme'解决办法
时间: 2023-11-17 10:08:03 浏览: 105
这个错误通常是由于Selenium版本不兼容或者缺少ChromeDriver导致的。解决方法如下:
1. 确保你已经安装了Chrome浏览器和ChromeDriver,并且ChromeDriver的版本与你的Chrome浏览器版本匹配。
2. 确保你已经正确安装了Selenium库。你可以通过在终端或命令提示符中输入“pip install selenium”来安装Selenium。
3. 如果你已经安装了Selenium库,但仍然遇到此错误,请尝试升级Selenium库到最新版本。你可以通过在终端或命令提示符中输入“pip install --upgrade selenium”来升级Selenium。
4. 如果你使用的是Python 3.x版本,请确保你的代码中使用的是“from selenium.webdriver.chrome.webdriver import WebDriver”而不是“from selenium import webdriver”。
5. 如果你使用的是Python 2.x版本,请确保你的代码中使用的是“from selenium.webdriver.chrome.webdriver import WebDriver”而不是“from selenium.webdriver import Chrome”。
相关问题
AttributeError: module 'selenium.webdriver' has no attribute 'Chorme'
这个错误通常是因为拼写错误导致的。正确的拼写应该是Chrome而不是Chorme。请检查你的代码中是否有这个错误拼写。如果没有拼写错误,那么可能是因为你的Chrome浏览器驱动没有正确配置。你可以按照以下步骤进行检查和配置:
1. 下载Chrome浏览器驱动chromedriver.exe(下载地址:http://chromedriver.storage.googleapis.com/index.html)。
2. 将chromedriver.exe放在Chrome浏览器安装目录下。
3. 将Chrome浏览器安装目录和Python安装目录添加到环境变量path中。
4. 确保你已经正确安装了selenium包。
如果你已经按照以上步骤进行了检查和配置,但仍然无法解决问题,那么可能是因为你的Chrome浏览器版本和驱动版本不匹配。你可以尝试更新Chrome浏览器和驱动程序,或者使用与你的Chrome浏览器版本相匹配的驱动程序。
AttributeError: module 'selenium.webdriver.chrome.webdriver' has no attribute 'chrome'
这个错误通常是因为你在使用selenium webdriver时,将浏览器类型设为了"chrome"而不是"Chrome"。请确保你的代码中浏览器类型的名称与实际的浏览器类型名称相匹配,例如:
```
from selenium import webdriver
driver = webdriver.Chrome() # 注意这里的浏览器类型是 "Chrome" 而不是 "chrome"
driver.get("https://www.google.com")
```
如果你的代码中已经正确地将浏览器类型设置为 "Chrome",那么可能是因为你的selenium webdriver版本过低,建议升级到最新版本。
阅读全文
相关推荐
















