Apologies if this has been answered elsewhere (I'm sure it will have been) but I've spent the past few days searching high and low, trying all the solutions I've come across.
I've been trying to automate some form completion on Chrome using Selenium and Python.
My solution works fine on a personal device but on my company machine I've been hitting some issues.
Running my test code, originally produced the "DevToolsActivePort file doesn't exist" error but I managed to get around that.
The script now opens a Chrome window but then produces an error:
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. (chrome not reachable) (The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
This is whilst the Chrome window does open and remains open. Unfortunately with this being a work machine I am unable to reinstall windows or Python at this time.
I've checked the versions and everything appears to line up.
Python: 3.7.0
Selenium: 3.141.0
Chrome: 91.0.4472.114
ChromeDriver: 91.0.4472.101 (also tried other versions)
Code Used:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")
options.add_argument("--disable-setuid-sandbox")
options.add_argument("--remote-debugging-port=9222")
options.binary_location = "C:\Program Files\Google\Chrome\Application\chrome.exe"
options.add_argument("--disable-dev-shm-using")
options.add_argument("--disable-extensions")
options.add_experimental_option("useAutomationExtension", True) #also tried False
options.add_argument("--disable-gpu")
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("user-data-dir=C:\\Users\\UP1170\\AppData\\Local\\Google\\Chrome\\User Data")
options.add_experimental_option("detach",True)
driver = webdriver.Chrome(chrome_options=options,executable_path="C:\\Users\\UP1170\\Desktop\\chromedriver.exe")
driver.get("https://www.google.com")
This is not the full code I've developed for the automation but a test script to just try and get Chrome to open on a company windows 10 laptop.
Anyone have any ideas?
I've got a feeling it's going to be linked to a company restriction placed on my device as a similar issue occurs when I've attempted this with both Firefox and Edge.