Feb-03-2021, 04:31 PM
I want to launch Python script on EdgeHTML (Edge v.18 Legacy), using Selenium. But I face a problem to do a connection. I'm trying to launch it on job computer, but I can't install MicrosoftWebDriver.exe in Windows/System32 folder, because of access rights. I want to make a path to MicrosoftWebDriver.exe, which I store in other location in computer, but it does not work. Instead, it turns off the Edge instance completely.
import ctypes from msedge.selenium_tools import Edge, EdgeOptions # Launch Microsoft Edge (EdgeHTML) driver = Edge(executable_path = r'C:\\Users\\zzz\\Desktop\\Projects\\MicrosoftWebDriver.exe') ctypes.windll.user32.MessageBoxW(0, driver.title, "Current page title", 0)When I try to run it, I get these errors in CMD:
Traceback (most recent call last): File "EdgeHTML.py", line 9, in <module> driver = Edge(executable_path = r'C:\\Users\\zzz\\Desktop\\Projects\\MicrosoftWebDriver.exe') File "C:\Users\zzz\AppData\Roaming\Python\Python37\site-packages\msedge\selenium_tools\webdriver.py", line 108, in __init__ desired_capabilities=desired_capabilities) File "C:\Users\zzz\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "C:\Users\zzz\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\zzz\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\zzz\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\errorhandler.py", line 208, in check_response raise exception_class(value) selenium.common.exceptions.WebDriverException: Message: Unknown error