简体   繁体   English

如何在 Python 中使用 selenium 启动 Microsoft Edge

[英]How do I launch Microsoft Edge with selenium in Python

I keep getting the error "module 'selenium.webdriver' has no attribute 'EdgeDriver'."我不断收到错误“模块'selenium.webdriver'没有属性'EdgeDriver'。” when I run it.当我运行它时。 What should I have in this line to launch Edge?我应该在这条线上有什么来启动 Edge?

self.driver = webdriver.EdgeDriver()

download latest version of Microsoft WebDriver.下载最新版本的 Microsoft WebDriver。

To see the edge browser version, Click on the three dots that you see on the top right corner on your edge browser (after address bar) and Settings link.要查看边缘浏览器版本,请单击边缘浏览器右上角的三个点(地址栏后)和设置链接。 You see version beside 'Microsoft EdgeHTML'您会在“Microsoft EdgeHTML”旁边看到版本

Once you download the 'MicrosoftWebDriver.exe' file, copy driver path / location as we do to launch Chrome and Firefox browsers.下载“MicrosoftWebDriver.exe”文件后,复制驱动程序路径/位置,就像我们启动 Chrome 和 Firefox 浏览器一样。

In order to launch Edge Browser, we need to specify the system property with the path of the MicrosoftWebDriver.exe file.为了启动 Edge Browser,我们需要使用 MicrosoftWebDriver.exe 文件的路径指定系统属性。

Try using:尝试使用:

self.driver = webdriver.Edge("PATH TO DRIVER HERE")

This will only work if you have the correct edge web driver installed.这仅在您安装了正确的边缘 web 驱动程序时才有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Selenium Python 无头运行 Microsoft Edge? - How to run Microsoft Edge headless with Selenium Python? 如何使用 Python 让 Microsoft Edge 单击另存为 - How do I get Microsoft Edge to click on SAVE AS with Python 微软边缘使用 python selenium - Using python selenium for Microsoft edge 如何使用 Selenium 和 Python 打开 Microsoft Edge - How to open up Microsoft Edge using Selenium and Python Selenium + Python:Microsoft Edge 警报 - 没有此类警报 - Selenium + Python: Microsoft Edge Alert - no such alert Python Selenium 新标签 Microsoft Edge - Python Selenium new tab Microsoft edge 为什么我会收到弃用警告:Microsoft Edge 的 Selenium 工具已弃用。 请升级到 Selenium 4? - Why do I get a deprecationWarning: Selenium Tools for Microsoft Edge is deprecated. Please upgrade to Selenium 4? 如何在 TravisCI 中使用 Python、Selenium 和 Linux 运行 Edge 和 msedgedriver 的开发版本? - How do I run the dev releases of Edge and msedgedriver with Python, Selenium, and Linux in TravisCI? 无法使用 Selenium Python EdgeOption 启动 Edge 浏览器 - Unable to launch Edge Browser using Selenium Python EdgeOption 如何使用 python 和 selenium 在 Internet Explorer(IE)模式下打开 Microsoft Edge? - How to open Microsoft Edge in Internet Explorer(IE) Mode using python and selenium?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM