close

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

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to open chrome webdriver with selenium But I am facing following error DeprecationWarning: executable_path has been deprecated, please pass in a Service object in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

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

I am trying to open chrome webdriver with selenium But I am facing following error.

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

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

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

    To Solve DeprecationWarning: executable_path has been deprecated, please pass in a Service object Error Here executable_path is deprecated you have to use an instance of the Service() class as follows. s = Service('C:/Users/…/chromedriver.exe') and then driver = webdriver.Chrome(service=s) Now, Your error must be solved.

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

    To Solve DeprecationWarning: executable_path has been deprecated, please pass in a Service object Error Here executable_path is deprecated you have to use an instance of the Service() class as follows. s = Service('C:/Users/…/chromedriver.exe') and then driver = webdriver.Chrome(service=s) Now, Your error must be solved.

Solution 1: Just use an instance of the Service()

Here executable_path is deprecated you have to use an instance of the Service() class as follows.

from selenium import webdriver

PATH = './chromedriver.exe'
driver = webdriver.Chrome(PATH)
driver.get("https://www.google.com")

This will Give You deprecated warning So You Have to use an instance of the Service() class instead of executable_path just like This.

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

s = Service('C:/Users/.../chromedriver.exe')
driver = webdriver.Chrome(service=s)

Now, Your error must be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment