[英]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.