Repository navigation
Use Brave Browser with standalone chromium #2745
Replies: 1 comment
|
Hi @hhohp-120kg
For a custom browser such as Brave, docker-selenium provides the supported environment variable: So instead of relying only on the client-side FROM selenium/standalone-chromium:<pinned-version>
USER root
RUN curl -fsS https://dl.brave.com/install.sh | sh
USER seluser
ENV SE_BROWSER_BINARY_LOCATION=/opt/brave.com/brave/braveThen the client can remain simple: from selenium import webdriver
options = webdriver.ChromeOptions()
driver = webdriver.Remote(
command_executor="http://localhost:4444",
options=options,
)docker-selenium's Chromium Node configuration uses I would also avoid replacing the image's One additional consideration is ChromeDriver compatibility. Brave is Chromium-based, but the ChromeDriver bundled in your Selenium image still needs to be compatible with the Chromium version embedded in the Brave release you install. If you get Please mark this answer as accepted if it helped, thank you. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm wondering if anyone has had success with setting the
options.binary_locationin theirwebdriver.Remote()setup. I am installing Brave (a chromium browser) in a custom docker image as follows:This installs Brave in the
/opt/brave.com/brave/bravedirectory. When I pass this directory to the options, I can see in the post-creation logs that is has been set - however the remote webdriver is not using it. No error is given, Chrome is simply used instead, which leads me to believe it is perhaps being ignored.I saw elsewhere that
options.set_capability("goog:chromeOptions", {"binary": brave_path})can help, however it did not solve the issue.I am thinking this is potentially to do with the
selenium/standalone-chromium:latestimage - when I run selenium grid locally withjava -jar selenium-server-4.30.0.jar standalone, then Brave works fine.Does the standalone chromium docker image only support Chrome? Any help is appreciated, thank you.
All reactions