Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Selenium driver for Brave browser?

Tags:

selenium

brave

I already have a fully operating scrape tool that uses Google Chrome. To make it go fast I programmatically configure it with ad blockers, tracker blockers, image blockers, pop up blockers, etc. (basically every kind of blocker). There are many lines of configuration code to maintain.

Along comes Brave.

Which has all of the blockers that I want - built in! It's also built on Chromium - just like Chrome. For this reason it would make sense that I could use the ChromeDriver with Brave. But does it really work?

So I tried it - and failed - with the following exception:

System.InvalidOperationException occurred
  HResult=0x80131509
  Message=unknown error: no chrome binary at C:\SOMEPATH\Brave64\app-0.22.22\brave.exe
  (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 6.1.7601 SP1 x86_64)
  Source=WebDriver
  StackTrace:
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
   at FOO.GOO.Historical.Scrape.Session.CreateDriver[T]() in D:\FOO\FOO.GOO.Historical.Scrape\Session.cs:line 211
   at FOO.GOO.Historical.Scrape.TestFixtures.Pages.PageTest.SessionSetUp(Boolean login) in D:\FOO\FOO.GOO.Historical.Scrape\TestFixtures\Pages\PageTest.cs:line 23
   at FOO.GOO.Historical.Scrape.TestFixtures.ScraperTests.SetUp() in D:\FOO\FOO.GOO.Historical.Scrape\TestFixtures\ScraperTests.cs:line 21

So clearly it isn't directly replaceable. The ChromeDriver indicates it wants a chrome binary, not a brave binary.

Can someone please explain if there is a driver that works for Brave? I'm already drooling over the performance gains.

like image 996
sapbucket Avatar asked Apr 23 '18 20:04

sapbucket


1 Answers

As stated in this answer brave browser fully supports chrome webdriver. You should have a look at chrome://version and check whether the webdriver and browser/chromium versions really match.

like image 59
Abrogans Avatar answered Nov 09 '22 21:11

Abrogans