0

I've been using python with selenium for quite some time now,but suddenly there's this error I'm getting while using the headless version of chrome driver.
This is the sample from the code ive been using;

from selenium import webdriver

chrome_options = Options()  
chrome_options.add_argument("--headless")  
driver = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver',chrome_options=chrome_options)
###Function that my code does###
driver.quit()

The Error that I'm getting is :

 browser = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver',chrome_options=chrome_options)
  File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
    % (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /usr/local/bin/chromedriver unexpectedly exited. Status code was: 1

Now I tried to find a solution through google but ended up with results that said to place the chromedriver in path and define that path in the python code itself.But all those things are already done, What silly mistake am I doing here?

Austin Joy
  • 59
  • 1
  • 12

1 Answers1

0

Ensure the version of Chrome you have installed is compatible with the version of ChromeDriver you're using. Per this answer, you can always find the latest compatibility information here:

https://sites.google.com/a/chromium.org/chromedriver/downloads

At this time, that compatibility table looks like this:

chromedriver    chrome
2.43            69-71
2.42            68-70
2.41            67-69
2.40            66-68
2.39            66-68
2.38            65-67
2.37            64-66
2.36            63-65
2.35            62-64
2.34            61-63
2.33            60-62
---------------------
2.28            57+
2.25            54+
2.24            53+
2.22            51+
2.19            44+
2.15            42+
s3cur3
  • 2,749
  • 2
  • 27
  • 42