close

[Fixed] DeprecationWarning: executable_path has been deprecated, please pass in a Service object

Today We are Going To Solve DeprecationWarning: executable_path has been deprecated, please pass in a Service object in Python. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix DeprecationWarning: executable_path has been deprecated, please pass in a Service object Error?

  1. How to Fix DeprecationWarning: executable_path has been deprecated, please pass in a Service object Error?

    To Fix DeprecationWarning: executable_path has been deprecated, please pass in a Service object Error just Use this code. To solve this error you can use the given below code and by using this you can solve your error easily. So try that! from selenium import webdriver from selenium.webdriver.chrome.service import Service ser = Service("C:\\chromedriver.exe") op = webdriver.ChromeOptions() s = webdriver.Chrome(service=ser, options=op)

  2. DeprecationWarning: executable_path has been deprecated, please pass in a Service object

    To Fix DeprecationWarning: executable_path has been deprecated, please pass in a Service object Error just Use the Chrome auto-installer. You can solve this error by just using the Chrome auto-installer. You can understand it better by giving the below code. So just try that to solve your error. from selenium import webdriver import chromedriver_autoinstaller from selenium.webdriver.chrome.service import Service chromedriver_autoinstaller.install() driver = webdriver.Chrome(service=Service())

Solution 1 : Use this code

To solve this error you can use the given below code and by using this you can solve your error easily. So try that!

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
ser = Service("C:\\chromedriver.exe")
op = webdriver.ChromeOptions()
s = webdriver.Chrome(service=ser, options=op)

Solution 2 : Use the Chrome auto-installer

You can solve this error by just using the Chrome auto-installer. You can understand it better by giving the below code. So just try that to solve your error.

from selenium import webdriver    
import chromedriver_autoinstaller
from selenium.webdriver.chrome.service import Service

chromedriver_autoinstaller.install()
driver = webdriver.Chrome(service=Service())

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read This Solutions

Leave a Comment