Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Selenium – TypeError: Can't instantiate abstract class Service without an implementation for abstract method 'command_line_args'

Firstly I want to point out that I’m new to python and web scraping and I was learning how to web scrape with selenium.

I precisely followed a tutorial on how to set it up and suddenly an error occured – I searched for fixes on the web but I couldn’t find one.

Can anyone help?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

here is a screenshot of the code:

https://i.sstatic.net/WXkIGRwX.png

>Solution :

Change this:

from selenium.webdriver.common.service import Service 

To:

from selenium.webdriver.chrome.service import Service

Suggestion: If you are using selenium v4.6.0 or higher, you don’t need to manually set the driver path. Hence you don’t need Service class.

Code can be as simple as:

from selenium import webdriver

driver = webdriver.Chrome()
driver.get("https://www.google.com/")
driver.quit()

Ref: https://stackoverflow.com/a/76463081/7598774

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading