1

WebDriverException: Message: Can not connect to the Service /usr/lib/chromium/chromium

One of the only places which seemed to show you how, but that might only work on Windows. That's where I got the code from. How to load default profile in chrome using Python Selenium Webdriver?

My code.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = webdriver.ChromeOptions() 
options.add_argument("user-data-dir=/home/me/.config/chromium/Default") #Path to your chrome profile
w = webdriver.Chrome(executable_path="/usr/lib/chromium/chromium", chrome_options=options)

w.get("https://google.com")  

The browser opens up, pauses, doesn't go to the URL, then gives me that error message.

This code stops giving me the error message, but my user data does not show up.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = webdriver.ChromeOptions()
config = "_config/"
chromedriver = config+"chromedriver"
options.add_argument("--profile-directory='Default'") #Path to your chrome profile
w = webdriver.Chrome(chromedriver, chrome_options=options)

w.get("https://google.com")  

And if I used this executable path instead, with everything else being the same, it opens up the browser with all of the desired user data, but then gives this error. WebDriverException: Message: Service chromium unexpectedly exited. Status code was: 0 The browser stays open:

w = webdriver.Chrome(executable_path="chromium", chrome_options=options)

thinkvitamin
  • 81
  • 1
  • 12
  • To avoid unnecessary complications you must not try to load the `Default Chrome Profile` as it may contain certain `AddOns` and other configurations. Either load a custom profile or let webdriver scoop up a new profile for you. – undetected Selenium Aug 08 '17 at 09:02
  • The only reason I want to do this is because I can't find a way to force https connections when starting up chromedriver the usual way. (red slash, red letters over https on occasion). By default, https everywhere doesn't force https... I can't find a way to make it do this in the code, but I can load that extension. https://stackoverflow.com/questions/45529823/is-there-a-way-to-force-selenium-webdriver-to-only-use-https – thinkvitamin Aug 08 '17 at 09:09
  • Possible duplicate of [selenium chrome attach default profile](https://stackoverflow.com/questions/15272785/selenium-chrome-attach-default-profile) – dank8 Sep 21 '17 at 00:37

0 Answers0