Python Forum
How to use Selenium on EdgeHTML, when having WebDrivers in other location?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use Selenium on EdgeHTML, when having WebDrivers in other location?
#1
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
Reply


Messages In This Thread
How to use Selenium on EdgeHTML, when having WebDrivers in other location? - by euras - Feb-03-2021, 04:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  With Selenium create a google Search list in Incognito mode withe specific location, tsurubaso 3 3,284 Jun-15-2020, 12:34 PM
Last Post: tsurubaso
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,647 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020