Marius
Marius

Reputation: 25

I am using Microsoft Edge Chromium with Selenium and I keep on getting the msedge.exe as a startup item

This is the code I used for using Selenium with Microsoft Edge Chromium browser:

from selenium.webdriver.edge.options import Options
from selenium.webdriver.edge.service import Service
from selenium.webdriver.edge.webdriver import WebDriver

driveroptions = Options()
driveroptions.use_chromium = True
driveroptions.add_argument('--start-maximized')
driveroptions.binary_location = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
service = Service(executable_path="msedgedriver.exe")

driver = webdriver.Edge(options=driveroptions, service=service)

And whenever I restart the system, I get more than 100 msedge.exe in the startup under Task Manager and get 100s of popups of msedge.exe command prompt like this Popups picture. I deleted them from the startup with Autoruns but I got them again after restart. Has anyone else encountered this issue?

Upvotes: 1

Views: 2637

Answers (1)

Adam D
Adam D

Reputation: 21

Had the same issue - disabling Microsoft Edge instances in "Startup Apps" helped but new instances got created every time the program runs...

Solved by using msedge-selenium-tools as recommended by MSDN (https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium?tabs=python)

Issue hasn't cropped up in several days.

Example code:

from msedge.selenium_tools import Edge, EdgeOptions

driverOptions = EdgeOptions()
driverOptions.use_chromium = True
driverOptions.binary_location = r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
driverOptions.add_argument("--headless")
driverOptions.add_experimental_option("excludeSwitches", ["enable-logging"])
driver = Edge(options=driverOptions)

#... use your driver

driver.close()
driver.quit()

EDIT:

Did some more testing and it looks like it is just the "driverOptions.add_experimental_option("excludeSwitches", ["enable-logging"])" that fixes this issue. (NOT using msedge.selenium_tools).

Upvotes: 1

Related Questions