How do I start Chromium instead of Chrome in python?

2,042 views
Skip to first unread message

jmill...@nvidia.com

unread,
Mar 27, 2013, 8:20:48 PM3/27/13
to chromedri...@googlegroups.com
I thought I had this working a while ago, but now I get Chrome instead of Chromium.

The code I tried is below...

from selenium import webdriver
webdriver.ChromeOptions().binary_location = '/usr/lib/chromium-browser/chromium-browser'
driver = webdriver.Chrome()
...

Which pops up a Chrome browser.

I swear in the past this worked, and I've double checked that running the specified location from my shell starts Chromium. I'm using version 23.x of chromedriver. I can try 26 or whatever the latest is, but I figured making more changes wouldn't be a good idea. I have updated Chrome and Chromium a number of times since I last saw this work, but as I said the location appears correct.

Thanks for any tips or URLs.

Ken Kania

unread,
Mar 28, 2013, 11:01:55 AM3/28/13
to jmill...@nvidia.com, chromedri...@googlegroups.com
If this did work before, it's because you didn't have Chrome installed before in a recognizable location, so it picked up Chromium.  The problem is you are not using ChromeOptions correctly.  Check the python documentation and try:

from selenium import webdriver
options = webdriver.ChromeOptions()
options.binary_location = '/usr/lib/chromium-browser/chromium-browser'
driver = webdriver.Chrome(chrome_options=options)





--
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/groups/opt_out.



Joe Millenbach

unread,
Mar 28, 2013, 12:48:10 PM3/28/13
to Ken Kania, chromedri...@googlegroups.com

Check the python documentation…”  I’m a bit of a python newb, so where is this?  I’ve tried a lot of searches and found bits and pieces around, but no definitive documentation.  Also I know python can have built in documentation, but I haven’t seen how to access it easily.  I use PyCharm if that helps…I should probably just Google this myself.

 

And thanks for the correct way to use this.  Is it expected I get the same driver.capabilities[‘browserName’] from both?  (u’chrome’)


This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Ken Kania

unread,
Mar 28, 2013, 1:16:59 PM3/28/13
to Joe Millenbach, chromedri...@googlegroups.com
I think http://selenium.googlecode.com/git/docs/api/py/index.html is the best reference.  You should get the browserName as chrome for either.
Reply all
Reply to author
Forward
0 new messages