GeckoDriver v0.23.0 is old and ancient now.
To use the recent version of firefox e.g. v116.0.2 you need the latest version of GeckoDriver e.g. v0.33.0
However, as you are using selenium4 you need to drop the keyword executable_path
as per the discussion executable_path has been deprecated selenium python.
So your effective code will be:
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
s = Service("/path/to/geckodriver")
driver = webdriver.Firefox(service=s)
driver.quit()
Moreover, Selenium Manager is the new tool which is now integrated with Selenium v4.6 onwards that helps us to get a working environment to run Selenium out of the box. Beta 1 of Selenium Manager will configure the browser drivers for Chrome, Firefox, Edge, etc, browser clients, even if they are not present on the PATH
.
So your minimal code can be:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.google.com/")