webdriver_manager icon indicating copy to clipboard operation
webdriver_manager copied to clipboard

TypeError: __init__() got an unexpected keyword argument 'service'

Open Hemenguelbindi opened this issue 3 years ago • 1 comments

Hello, I use selenium = = 3.141.0 and when I started it, I wrote an error when studying the changes in the selenium itself, I found that the service method is no longer there, instead of it there is a method servce_arg in which, as I understand it, you need to put a list of servers, but when changing to this manner of writing code:

from selenium import webdriver
from webdriver_manager.firefox import GeckoDriverManager

browser = webdriver.Firefox(service_args=[GeckoDriverManager().install()])
browser.get("http://localhost:8000")

assert 'Django' in browser.title

I get this error:

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

I thought that this problem is only with this browser, but no, here is an example of code on Chrom

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

browser = webdriver.Chrome(service_args=[ChromeDriverManager().install()])
browser.get("http://localhost:8000")

assert 'Django' in browser.title

And men come here is such a mistake

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Thank you in advance for your attention to my problem.

Hemenguelbindi avatar May 19 '23 18:05 Hemenguelbindi

Close isse use v selenium==4.9.1

Hemenguelbindi avatar May 20 '23 06:05 Hemenguelbindi