-2

My chromium version is 87.0.4280.88

My brave browser version is 87.0.4280.101

I tried a lot of codes but they didn't work.

Code:

from selenium import webdriver

option = webdriver.ChromeOptions()
option.binary_location = r'C:\Program Files (x86)\BraveSoftware\Brave- 
Browser\Application\brave.exe'
driver = webdriver.Chrome(
executable_path=r'C:\WebDrivers\chromedriver.exe', options=option)
driver.get("https://www.google.com")

Error traceback:

Traceback (most recent call last):
File "c:\Users\MOHSEN\Desktop\test\Untitled-1.py", line 5, in <module>
driver = webdriver.Chrome(
TypeError: __init__() got an unexpected keyword argument 'options'
DapperDuck
  • 2,728
  • 1
  • 9
  • 21
  • 4
    You're going to need to supply a lot more detail. – Reinderien Jan 02 '21 at 01:42
  • You will need to add: Python version, the code you are trying to execute, selenium driver version, and the error you are getting. – LearnIT Jan 02 '21 at 02:21
  • In [this](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) list, from selenium's official website. Brave isn't listed here. – YJH16120 Jan 02 '21 at 03:24
  • can you put the error and code here? – Darkknight Jan 02 '21 at 03:35
  • Please read [ask], especially the part about [mcve] (MCVE), and [How much research effort is expected?](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) This will help you debug your own programs and solve problems for yourself. If you do this and are still stuck you can come back and post your MCVE, what you tried, and the execution result including any error messages so we can better help you. Also provide a link to the page and/or the relevant HTML. – JeffC Jan 02 '21 at 04:04

1 Answers1

0

To initiate a Browsing Session using Selenium driven WebDriver you can use the following solution:

  • Code Block:

    from selenium import webdriver
    
    option = webdriver.ChromeOptions()
    option.binary_location = r'C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe'
    driver = webdriver.Chrome(executable_path=r'C:\WebDrivers\chromedriver.exe', options=option)
    driver.get("https://www.google.com")
    
  • Browser Snapshot:

Brave

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I tried that and got this message Traceback (most recent call last): File "c:\Users\MOHSEN\Desktop\test\Untitled-1.py", line 5, in driver = webdriver.Chrome( TypeError: __init__() got an unexpected keyword argument 'options' – Hason Soliman Jan 03 '21 at 01:13