0

I am trying to run some scripts with seleniun and am getting this error:

Traceback (most recent call last):
  File "/var/www/pyscripts/qualidental.py", line 12, in <module>
    driver = webdriver.Chrome(BASE_WEB_DRIVER, options=chrome_options)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.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/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Details, I'm doing this on a text mode server only (debian 8)

My code:

BASE_WEB_DRIVER = "/scripts/chromium-browser/chromedriver"
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument('--incognito')
chrome_options.add_argument('--headless')
driver = webdriver.Chrome(BASE_WEB_DRIVER, options=chrome_options)

My version Chrome: Google Chrome 78.0.3904.108

My version driver: ChromeDriver 78.0.3904.105 (60e2d8774a8151efa6a00b1f358371b1e0e07ee2-refs/branch-heads/3904@{#877})

JB_
  • 533
  • 1
  • 6
  • 18
  • It looks like your Google Chrome (not chomedriver) process is crashing. Can you start google chrome on its own? – Brydenr Nov 26 '19 at 22:08
  • As it is on the text mode server, there is no way to start chrome, so I used the options so that the chrome script doesn't open chrome. I didn't find another way to do it without using chrome. – JB_ Nov 26 '19 at 22:10
  • Does your Chrome Driver Version match your version of Chrome? – KILLtheWEEZEL Nov 26 '19 at 22:10
  • The Chrome Driver + Chrome setup is **very** susceptible to version mismatch. Make sure you're on compatible versions. – Javier Silva Ortíz Nov 26 '19 at 22:12
  • I'll check it out now. – JB_ Nov 26 '19 at 22:13
  • edited the question with chrome and drive version, More by documentation is correct – JB_ Nov 26 '19 at 22:22
  • 1
    Does running `/usr/bin/google-chrome` cause an error? – Brydenr Nov 26 '19 at 22:27
  • `[15212:15212:1126/122809.037926:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.` – JB_ Nov 26 '19 at 22:28

0 Answers0