I have a chrome selenium driver on a linux server which is executed every hour by cron. The error I have occurs only on the subsequent runs, that is, during the first run it works fine, but during the 2nd or any other sub-sequential one it fails.
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.0-38-generic x86_64)
I run it this way:
def create_ch_driver():
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--user-agent={}".format(config.USER_AGENT))
return webdriver.Chrome("/usr/local/bin/chromedriver", chrome_options=chrome_options)