I need to load my default chrome profile in selenium chrome web driver, and force some preferences in it using add_experimental_options() but it does not seems to work.
I tried using add_experimental_data but no luck.
#intializing chrome
options = Options()
#loading default profile
options.add_argument("--user-data-dir=C:\\Users\\Jawad Ahmad
Khan\\AppData\\Local\\Google\\Chrome\\User Data")
#loading preferences
options.add_experimental_option("prefs", {
"download.default_directory": directoryToSave,#r'C:\Users\Jawad Ahmad Khan\Desktop\webscraping\download/downloaded files',
"plugins.always_open_pdf_externally": True,
"download.prompt_for_download": False,
"download.directory_upgrade": True,
"safebrowsing.enabled": True
})
I need to load my default chrome profile with active logins and force my preferences on it. But the preferences i defined using options.add_experimental_option() not seems to work.