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.
Contents
How to Fix DeprecationWarning: executable_path has been deprecated, please pass in a Service object Error?
- 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)
- 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
- cv2.error: OpenCV(4.5.2) color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor’
- Can’t import the named export ‘Children’ from non EcmaScript module (only default export is available)
- VM305:5551 crbug/1173575, non-JS module files deprecated
- oduleNotFoundError: No module named ‘torch’
- The origin server did not find a current representation for the target resource or is not willing to disclose that one exists