get() missing 1 required positional argument: 'self' error using Selenium 4.3.0 and Python


I used to have a script to access to websites, the thing is that one day stoppe working because this error: "executable_path has been deprecated, please pass in a Service object". So, I updated Selenium and update the script too:

from selenium import webdriver
from import Service
from selenium.webdriver.common.keys import Keys

service = Service(executable_path="C:/Users/XXXXX/chromedriver.exe")
browser = webdriver.Chrome

Now I got this error:

get() missing 1 required positional argument: 'self'

I know is a simply error but I cannot solve it.

P.s: the XXX are just for confidentiality

When I tried this:

service = Service(executable_path="C:/Users/fer14538/chromedriver.exe")
browser = webdriver.Chrome(service=service)`
browser = webdriver.Chrome

I got this error:

Ordinal0 [0x0043F8D1+2029777]
BaseThreadInitThunk [0x7534FA29+25]
RtlGetAppContainerNamedObjectPath [0x77487A9E+286]
RtlGetAppContainerNamedObjectPath [0x77487A6E+238]


Instead of:

browser = webdriver.Chrome

You need to invoke the Chrome() method passing the service object and simply pass the url_string as an argument to get() as follows:

service = Service("C:/Users/XXXXX/chromedriver.exe")
browser = webdriver.Chrome(service=service)


You can find a couple of relevant detailed discussion in:

Answered By – undetected Selenium

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published