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

what is wrong with service in the following code?

I am trying to test my web page. I have the following code:

# Internet Explorer Browser version
from selenium import webdriver
from selenium.webdriver.ie.service import Service
from webdriver_manager.microsoft import IEDriverManager
driver = webdriver.Ie(service=Service(executable_path=IEDriverManager().install()))

driver.get('https://www.google.com')

The said code gives the following error:

[WDM] - Downloading: 100%|█| 1.03M/1.03M [00:00<00:00, 19.
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    driver = webdriver.Ie(service=Service(executable_path=IEDriverManager().install()))
TypeError: __init__() got an unexpected keyword argument 'service'

What should I do, and what is the reason for the error message?

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

>Solution :

Change the line to below as you are using IEDriverManager in this case you do not need to define the executable_path

driver = webdriver.Ie(service=Service(IEDriverManager().install()))

You can find the more detail here

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