0

I can successfully launch my user Chrome profile on web driver but I cannot force my preferences on this user profile using add_experimental_option.

While the add_experimental_option work on default driver chrome instance but does not seems to work when I load my user chrome profile which I usually use on the system.

I tried using add_experimental_option to force my preferences like changing download directory, auto-download start, etc but these do not seem to work.

#intializing chrome
opts = Options()

#loading default profile
opts.add_argument("--user-data-dir=C:\\Users\\Jawad Ahmad 
Khan\\AppData\\Local\\Google\\Chrome\\User Data")

opts.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 want to force my preferences on default Chrome profile launched using web driver.

Jawad Ahmad Khan
  • 279
  • 6
  • 19

0 Answers0