Skip to content

"WebDriverException: Message: chrome not reachable" When loading chrome profile #5998

@eloiup

Description

@eloiup

I am unsure if i should post this issue here or at

"If the issue is with Google Chrome consider logging an issue with chromedriver instead:
https://sites.google.com/a/chromium.org/chromedriver/help"

Hence I will be posting at both, but any help here is very much appreciated!


selenium version 2.53.6
ubuntu 16.04
python 2.7.15 on anaconda//jupyter notebook
chromedriver 2.39

Trying to run headless chrome

If I:

from selenium import webdriver

options = webdriver.ChromeOptions() 
options.add_argument('--headless')
driver = webdriver.Chrome(executable_path="gdrive_path", chrome_options=options)

it works fine
However, i have a warsaw plugin installed, which by my understanding is on associated to the chrome profile. Hence i need to load it.

So, if i try:

from selenium import webdriver

options = webdriver.ChromeOptions() 
options.add_argument('--headless')
options.add_argument("--user-data-dir=/home/ubuntu/.config/google-chrome") #Path to your chrome profile
driver = webdriver.Chrome(executable_path=gdrive, chrome_options=options)

It shld work, but instead I get an error msg:

---------------------------------------------------------------------------
WebDriverException                        Traceback (most recent call last)
<ipython-input-5-db496bd122c0> in <module>()
      4 options.add_argument('--headless')
      5 options.add_argument("user-data-dir=/home/ubuntu/.config/google-chrome") #Path to your chrome profile
----> 6 w = webdriver.Chrome(executable_path=gdrive, chrome_options=options)

/home/ubuntu/anaconda2/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.pyc in __init__(self, executable_path, port, chrome_options, service_args, desired_capabilities, service_log_path)
     67                 command_executor=ChromeRemoteConnection(
     68                     remote_server_addr=self.service.service_url),
---> 69                 desired_capabilities=desired_capabilities)
     70         except:
     71             self.quit()

/home/ubuntu/anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.pyc in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector)
     88         self.error_handler = ErrorHandler()
     89         self.start_client()
---> 90         self.start_session(desired_capabilities, browser_profile)
     91         self._switch_to = SwitchTo(self)
     92         self._mobile = Mobile(self)

/home/ubuntu/anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.pyc in start_session(self, desired_capabilities, browser_profile)
    175         if browser_profile:
    176             capabilities['desiredCapabilities']['firefox_profile'] = browser_profile.encoded
--> 177         response = self.execute(Command.NEW_SESSION, capabilities)
    178         self.session_id = response['sessionId']
    179         self.capabilities = response['value']

/home/ubuntu/anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.pyc in execute(self, driver_command, params)
    234         response = self.command_executor.execute(driver_command, params)
    235         if response:
--> 236             self.error_handler.check_response(response)
    237             response['value'] = self._unwrap_value(
    238                 response.get('value', None))

/home/ubuntu/anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.pyc in check_response(self, response)
    190         elif exception_class == UnexpectedAlertPresentException and 'alert' in value:
    191             raise exception_class(message, screen, stacktrace, value['alert'].get('text'))
--> 192         raise exception_class(message, screen, stacktrace)
    193 
    194     def _value_or_default(self, obj, key, default):

WebDriverException: Message: chrome not reachable
  (Driver info: chromedriver=2.39.562737 (dba483cee6a5f15e2e2d73df16968ab10b38a2bf),platform=Linux 4.4.0-1060-aws x86_64)

any advice?

Ty!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions