1

I am trying to launch chromium browser with selenium python on windows 8.

Added binary_location as chromium binary location which is appdata. But still chromedriver starts google chrome instead of chromium.

If I uninstall google chrome, then chromedriver by default launches chromium. But with chrome installed it always launches chrome regardless.

Does anyone have an idea on how to start chromium with selenium while chrome installed?

Please do not mark it as duplicate. The other one was about unix and solution provided to selenium java while this one is about windows and python.

1

2 Answers 2

1

Try this:

from selenium.webdriver.chrome.options import Options

options = Options()
options.binary_location = r"D:\.....\chrome.exe"
# This line defines your Chromium exe file location.

driver = webdriver.Chrome(chrome_options=options)
driver.get('https://www.google.com/')

Worked for me. I installed both Chrome and Chromium. It starts the specified exe.

Sign up to request clarification or add additional context in comments.

5 Comments

Do you have google chrome installed on your machine? Because this doesn't works for me if i install chrome parallely. It launches chrome instead.
@VaspandiNallasamy Yes, I have both installed. Chrome in: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", Chromium in "C:\Users\mingchau\AppData\Local\Chromium\Application\chrome.exe"
Found the culprit, latest chromedriver was the issue. Tested with chromedriver 2.36 and chromium 65 working fine. Accepting your answer.
@VaspandiNallasamy why did you accept an answer that is completely unrelated to how you solved your issue?
chrome_options key is a deprecated argument for options, as by doc. Use desired_capabilities instead
1

To start Chromium browser you can use the following code block :

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

options = Options()
options.binary_location("C:\\path\\to\\chrome.exe") //path to chromium binary
options.add_argument("start-maximized")
options.add_argument("--disable-gpu-vsync") //only for Windows
options.add_argument("--remote-debugging-port=9222") //for MAC & Linux
driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', chrome_options=options)
driver.get('http://google.com/')

Note : Here you can find more details about Run Chromium with flags

1 Comment

Thanks man, its working fine with older version of chromedriver

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.