简体   繁体   中英

How do I launch Microsoft Edge with selenium in Python

I keep getting the error "module 'selenium.webdriver' has no attribute 'EdgeDriver'." when I run it. What should I have in this line to launch Edge?

self.driver = webdriver.EdgeDriver()

download latest version of 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'

Once you download the 'MicrosoftWebDriver.exe' file, copy driver path / location as we do to launch Chrome and Firefox browsers.

In order to launch Edge Browser, we need to specify the system property with the path of the MicrosoftWebDriver.exe file.

Try using:

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

This will only work if you have the correct edge web driver installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM