Home > Back-end >  when running selenium Edge in pyton- getting "sedgedriver.exe unexpectedly exited. Status code
when running selenium Edge in pyton- getting "sedgedriver.exe unexpectedly exited. Status code

Time:07-04

I'm runing a python code in Edge selenium:

driver = webdriver.Edge(service=Service(executable_path=EdgeChromiumDriverManager().install()))
driver.get(login_url)
driver.maximize_window()
sleep_val = random.randint(0, 2)
time.sleep(sleep_val)
driver.get(check_url)
sleep_val = random.randint(0, 3)
time.sleep(sleep_val)
print("user id is:        "   user_name)
print("user pass is:        "   password)

after upgrading selenium version and python version to 3.10 , I'm getting an error:

selenium.common.exceptions.WebDriverException: Message: Service C:\Users\XXXt\.wdm\drivers\edgedriver\win64\103.0.1264.37\msedgedriver.exe unexpectedly exited. Status code was: 1

any solution?

CodePudding user response:

While passing the absolute path of the ChromeDriver binary through the argument executable_path you need to mention the path within single quotes (i.e. '') seperated by a single forward slash (i.e. ) along with the raw switch (i.e. r) as follows:

from selenium import webdriver

driver = webdriver.Chrome(executable_path=r'U:Scrapingchromedriver.exe')
driver.get(url)

WebDriverException: Service U:/Scraping/chromedriver.exe unexpectedly exited. Status code was: 1 while working with Chrome and Python

Answered by bart-cubrich

CodePudding user response:

There are various issues for chromium drivers for browser v103 used by Edge and Google Chrome. These are being addressed in v104, but they are still in beta.

Advise that you downgrade for now to v102.

See problem links here:
Bug in either Webdriver 103.. or Edge 103.. - unexpected command response
Issue 4121: WebDriver command sometimes fails with "unexpected command response"
[

  • Related