Open terminal/cmd: geckodriver --version If "command not found", fix PATH.
Download the specific bit version ( win64 vs win32 ) of geckodriver that precisely matches the bit version of your Firefox installation.
c# - 'Cannot start the driver service on http://localhost:60681/' — a brute-force but effective way to clear
When you write a Selenium script, the following happens behind the scenes:
If you are manually defining a FirefoxDriverService , ensure you aren't passing the path to the itself where the code expects the geckodriver executable. If you updated Firefox today, your driver might be obsolete
— a brute-force but effective way to clear all stale processes.
Check the log file for specific error messages that indicate why the driver service failed to start. If you updated Firefox today
Note: Even if you specify the path, ensure geckodriver.exe matches the version of your installed Firefox browser. If you updated Firefox today, your driver might be obsolete.
from selenium.webdriver.firefox.service import Service
This is the culprit in 80% of cases. You cannot use arbitrary versions of Selenium, GeckoDriver, and Firefox. They speak a specific protocol. If the versions don't align, GeckoDriver starts (you might see a flash of a console window) and then immediately crashes, taking the localhost service down with it.
Cannot start the driver service on http://localhost #372 - GitHub