Issues with selenium and Brave browser

55 Views Asked by At

Well, I have been trying to get into web scraping with selenium and works well on one of my devices with Chrome. But if possible i would like to use it on a different device of mine with Brave browser. I have tried some suggestions mentioned here but sadly none of them work anyone either due to selenium undergoing updations or I am missing something important.

These are my browser's specs tho:

1.63.169 Chromium: 122.0.6261.111 (Official Build) (64-bit)

1

There are 1 best solutions below

0
Lakshmanarao Simhadri On BEST ANSWER

Please make sure that you are using a latest version of selenium and compatible chromedriver. The below code snippet is working fine and the specs are Ubuntu 22.04.4 LTS and 1.63.169 Chromium: 122.0.6261.111 (Official Build) (64-bit)

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()

# Specify the path to the Brave binary
# To find the executable path, type brave://version/ into the brave address bar and look for "Executable Path" field
brave_binary_path = '/snap/brave/371/opt/brave.com/brave/brave'
chrome_options.binary_location = brave_binary_path

# Initialize the ChromeDriver with the configured options
driver = webdriver.Chrome(options=chrome_options)

url = "https://www.test-site.com/"
driver.get(url)

driver.quit()