The code starts the browser, stops at this step (line 5), and after a while throws an error:
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service C:\Program Files\Mozilla Firefox\firefox.exe
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
s = Service(r'C:\Program Files\Mozilla Firefox\firefox.exe')
driver = webdriver.Firefox(service=s)
driver.get('http://www.google.com')
myPageTitle = driver.title
print(myPageTitle)
driver.quit()
Firefox - 95.0.2 Selenium - 4.1.0
I tried with chrome, same problem
Does anyone know what the problem is and how to solve it?