1

I installed the most up-to-date version of Chrome, then I verified that the execution_path of the webdriver.Chrome was deprecated, I put the Selenium Service lib and still I can't connect, what could be happening in the code?

def create_selenium_driver():

  chrome_options = webdriver.ChromeOptions()
  chrome_options.add_argument('--no-sandbox')
  chrome_options.add_argument('--headless')
  chrome_options.add_argument('--disable-dev-shm-usage')
  prefs = {"download.default_directory" : "/tmp/chrome_downloads/", 'profile.default_content_setting_values.automatic_downloads': 1}
  chrome_options.add_experimental_option("prefs",prefs)
  chrome_driver = "/tmp/chromedriver/chromedriver"
  
  s = Service(chrome_driver)
  driver = webdriver.Chrome(service=s, options=chrome_options)

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Felipe FB
  • 1,212
  • 6
  • 22
  • 55

1 Answers1

2

This error message...

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally." (Driver info: chromedriver=97)

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

Chrome_96_0_4664_45

  • But you are using chromedriver=97
  • Release Notes of chromedriver=97.0 clearly mentions the following :

Supports Chrome version 97

So there is a clear mismatch between chromedriver=91.0 and the chrome=96.0.4664.45


Solution

Ensure that:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352