default location for chromedriver on linux?

4,195 views
Skip to first unread message

yi.j...@gmail.com

unread,
Nov 6, 2015, 5:13:04 PM11/6/15
to ChromeDriver Users
I found this as an expected location of driver on document page: /usr/bin/google-chrome
However, I'm using Dreamhost, which doesn't give me access to this location. I need to pay for for the service that I can sudo as an admin user.
So is it possible for me to work around this default location?
I tried the following (found from stackoverflow):
chromedriver = "path...path/chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
browser = webdriver.Chrome(chromedriver)

But it doesn't work. It gave me error: cannot find Chrome binary
Seems like another problem:(

I really appreciate if anyone can help! Thanks ahead!!

gmani...@google.com

unread,
Nov 6, 2015, 5:54:35 PM11/6/15
to ChromeDriver Users, yi.j...@gmail.com

You can use ChromeOptions to launch chrome executable in non-standard location.

In python :-
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

opts = Options()
opts.binary_location = "path/to/chrome"
driver = webdriver.Chrome(chrome_options=opts, executable_path="/path/to/chromedriver")
driver.get('http://google.com')

In Java :-
System.setProperty("webdriver.chrome.driver", “/path/to/chromedriver");
ChromeOptions options = new ChromeOptions();
options.setBinary(“/path/to/chrome”);
WebDriver driver = new ChromeDriver(options);

And to find the location of Chrome, you may follow the below steps:-
1) Launch chrome browser manually
2) Navigate to chrome://version
=> Here, use the path displayed against "Executable Path: "

Yi Jiao

unread,
Nov 6, 2015, 6:44:50 PM11/6/15
to gmani...@google.com, ChromeDriver Users
Thank you for your detailed reply!!
Does it mean I need to install Chrome on the server? 
I couldn't image how it can interact with my local Chrome path (C://...)
--
With kind regards, 
------------------------------------------------------------
Yi Jiao (Joey),

Aditya Gautam

unread,
Nov 9, 2015, 1:03:31 AM11/9/15
to Yi Jiao, Gauri Manikpure, ChromeDriver Users
Yes, your test machine should have chrome installed and chromedriver in specified local path.

--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yi Jiao

unread,
Nov 11, 2015, 11:25:44 PM11/11/15
to Aditya Gautam, Gauri Manikpure, ChromeDriver Users
Thank you very much! I've got it running on my server now:)
Reply all
Reply to author
Forward
0 new messages