I get this error when trying to use Undetected chromedriver

118 Views Asked by At

I can use selenium, but I encounter this error when I want to use undetected chrome driver.

uc.install()
chrome_driver_yolu = "C:\\Users\\omer\\Desktop\\ducky\\chromedriver.exe"
driver = uc.Chrome(executable_path=chrome_driver_yolu)
driver.get('https://distilnetworks.com')

and this is error

 WebDriver.__init__() got an unexpected keyword argument 'executable_path' 
1

There are 1 best solutions below

0
Michael Mintz On

Don't pass the executable_path to uc.Chrome(). Just make sure you're using the latest version, and it will get the driver automatically for you. Eg.

import undetected_chromedriver as uc

driver = uc.Chrome()
driver.get("https://nowsecure.nl/#relax")
driver.save_screenshot("nowsecure.png")
driver.quit()

(For https://github.com/ultrafunkamsterdam/undetected-chromedriver)


Or if you're using https://github.com/seleniumbase/SeleniumBase instead (includes a modified version of undetected-chromedriver), make sure to pass in uc=True.

from seleniumbase import Driver

driver = Driver(uc=True)
driver.get("https://nowsecure.nl/#relax")
driver.save_screenshot("nowsecure.png")
driver.quit()