This error message…
DeprecationWarning: executable_path has been deprecated, please pass in a Service object
…implies that the key executable_path
will be deprecated in the upcoming releases.
This change is inline with the Selenium 4.0 Beta 1 changelog which mentions:
Deprecate all but
Options
andService
arguments in driver instantiation. (#9125,#9128)
Solution
Once the key executable_path
is deprecated you have to use an instance of the Service()
class as follows:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
s = Service('C:/Users/.../chromedriver.exe')
driver = webdriver.Chrome(service=s)
TL; DR
You can find a couple of relevant detailed discussion in: