Selenium Webdriver Service object

I 'm lookin for a tutorial on how to write a python script using Selenium v4.0.0 and Brave browser (Chromium v95.0.4638.69).
I want to use the most updated code using a service object. Below is the code for chrome. How do I do the same thing for Brave?

# import statements
from selenium import webdriver
from selenium.webdriver.chrome.service import Service

# Declare variables and setup services
driverService = Service('C:/webdrivers/chromedriver.exe')   
# 1. Passes the chromedriver path to the service object
# 2. stores the service object in the s variable
driver = webdriver.Chrome(service=driverService)            
# 1. Passes service object s into the webdriver.Chrome  
# 2. Stores object in driver variable 

# Body (actually doing stuff)
driver.maximize_window()                # maximizes the browser window
driver.get("https://www.google.com")    # navigates to google.com
myPageTitle = driver.title              
# gets the title of the web page stores in myPageTitle
print(myPageTitle)                      # prints myPageTitle to Console
assert "Google" in myPageTitle          
# checks myPageTitle to ensure it contains Google

# clean up
driver.quit()                           # closes the browser
1 Like

+1

Please help. I have the same question and no other forum has helped.