By default, chrome will be run with this command line:
\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"
--disable-hang-monitor
--disable-
You should start browser by yourself and then tell selenium, that you already have it launched via passing special channel id. Something like that:
from random import randrange
channel_id = "%032x" % randrange(16**32)
from subprocess import Popen
# HERE YOU PASS ONLY THOSE PARAMETERS YOU WANT (i.e. without --disable-*)
# BUT YOU MAY NEED --dom-automation FOR SOME ROUTINES
chrome = Popen(" ".join([
PATH_TO_CHROME_EXE,
"--no-first-run", "--dom-automation",
("--testing-channel=\"NamedTestingInterface:%s\"" % channel_id),
]))
try:
from selenium.webdriver.chrome.service import Service
chromedriver_server = Service(PATH_TO_CHROMEDRIVER, 0)
chromedriver_server.start()
from selenium.webdriver import Remote
driver = Remote(chromedriver_server.service_url,
{"chrome.channel": channel_id, "chrome.noWebsiteTestingDefaults": True})
driver.get(MY_WEBPAGE)
# DO YOUR WORK
finally:
chromedriver_server.stop()
driver.quit()
chrome.kill()
chrome.wait()