module 'selenium.webdriver' has no attribute 'Edge'
时间: 2024-05-15 16:10:59 浏览: 25
这个错误信息提示是由于在调用selenium.webdriver.Edge时,没有找到对应的模块或者驱动程序。这个问题通常是由于你的系统中没有正确安装Microsoft Edge浏览器导致的。
要解决这个问题,你需要按照以下步骤操作:
1. 确认你已经安装了Microsoft Edge浏览器。如果你没有安装Microsoft Edge,请先从官方网站下载并安装它。
2. 确认你已经安装了正确的Microsoft Edge浏览器驱动程序。你可以从Selenium官方网站下载对应的驱动程序,然后将它放在系统PATH环境变量所指定的路径下。
3. 确认你的Python环境中已经安装了selenium库,并且使用正确的语法来调用Edge浏览器。
如果你按照以上步骤操作仍然无法解决问题,可以尝试使用其他浏览器驱动程序,例如Chrome或Firefox。
相关问题
module 'selenium.webdriver.edge' has no attribute 'get'
这个问题的原因是使用了'selenium.webdriver.edge'模块的 'get' 属性,但该属性不存在。根据引用和引用的信息,报错信息中的"module 'selenium.webdriver' has no attribute"可以说明selenium.webdriver模块中并不存在'get'属性。因此,可能是代码中有误,导致使用了错误的模块或属性。请检查代码中是否正确导入了正确的模块,并确保使用的是正确的属性。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [已解决(最新版selenium报错)AttributeError: module ‘selenium.webdriver‘ has no attribute ...](https://blog.csdn.net/yuan2019035055/article/details/125830305)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [webdriver不能启动浏览器,报module 'selenium.webdriver' has no attribute"问题解决办法](https://blog.csdn.net/qq_37006859/article/details/105998559)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
AttributeError: module 'selenium.webdriver' has no attribute 'Edge'
这个错误提示是因为selenium.webdriver模块中没有Edge这个属性,可能是因为你使用了错误的浏览器类型名称。如果你想使用Edge浏览器,你需要安装相应的Edge驱动程序并在代码中指定它。你可以使用以下代码来指定Edge驱动程序:
```
from selenium import webdriver
# 指定Edge驱动程序路径
edge_driver_path = "path/to/edge/driver"
# 创建Edge浏览器对象
driver = webdriver.Edge(executable_path=edge_driver_path)
```
另外,如果你不需要使用Edge浏览器,你可以选择其他支持的浏览器类型,例如Chrome、Firefox等。