我根据这篇文章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)
我得到这个错误:
TypeError: add_experimental_option() missing 1 required positional argument: 'value'
我究竟做错了什么...