2

I used the following code according to this post Set chrome.prefs with python binding for selenium in chromedriver

chroptions = webdriver.ChromeOptions

chroptions.add_experimental_option('prefs',{'download.default_directory' : 'C:\\Users\\elek2'})

browser = webdriver.Chrome(executable_path ='C:\\Users\\elek2\\AppData\\Local\\chromedriver.exe', chrome_options = chroptions)

and I get this error:

TypeError: add_experimental_option() missing 1 required positional argument: 'value' 

What am I doing wrong...

Community
  • 1
  • 1
Helena K
  • 469
  • 2
  • 6
  • 15

1 Answers1

7

You need to create an instance of Options. Currently you're just accessing the class itself.

chroptions = webdriver.ChromeOptions()
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895