from selenium import webdriver driver_path = "C:/Users/username/PycharmProjects/chromedriver.exe" brave_path = "C:/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe" option = webdriver.ChromeOptions() option.binary_location = brave_path # option.add_argument("--incognito") OPTIONAL # option.add_argument("--headless") OPTIONAL # Create new Instance of Chrome browser = webdriver.Chrome(executable_path=driver_path, chrome_options=option) browser.get("https://www.google.es")
Here is what the above code is Doing:
1. We’re creating a new instance of the Chrome driver.
2. We’re specifying the path to the Brave browser.
3. We’re adding the incognito and headless options.
4. We’re opening the Google homepage.