Reputation: 489
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...
Upvotes: 2
Views: 7028
Reputation: 600059
You need to create an instance of Options. Currently you're just accessing the class itself.
chroptions = webdriver.ChromeOptions()
Upvotes: 7