0

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.

Jawad Ahmad Khan
  • 279
  • 6
  • 19
  • options.add_experimental_option preferences not working when i load my chrome default profile can you please help i am stuck here. – Jawad Ahmad Khan May 29 '19 at 15:14
  • When i load my profile using options.add_argument("--user-data-dir=C:\\Users\\Jawad Ahmad Khan\\AppData\\Local\\Google\\Chrome\\User Data") My preferences do not work can you please help. – Jawad Ahmad Khan May 29 '19 at 15:15
  • These possible duplicates are not answering my question please have a look, i need to force my preferences on google default profile but they are not working. – Jawad Ahmad Khan May 29 '19 at 18:49
  • 1
    Seems this question is not a duplicate. Moving forward while providing additional information/clarification **please** add `@` along with the username, so the message is directly delivered to the inbox. Re-opening the question. – undetected Selenium May 29 '19 at 20:53
  • @DebanjanB i have edited the question, its the user profile when i load my user data profile with active logins and bookmarks etc, the add_experimental_options() does not work on it. – Jawad Ahmad Khan May 30 '19 at 13:13
  • I am sure your issue is **not** with `add_experimental_options()` **does not work** but with something else. Can you be specific where are you stuck exactly? – undetected Selenium May 30 '19 at 13:22
  • The above code is what i am using, web driver is opening my chrome with active logins and bookmarks but not forcing "download.prompt_for_download". – Jawad Ahmad Khan May 30 '19 at 16:26
  • who.int/intellectualproperty/documents/thereport/… this is the link, i want it to start automatically not want browser to open a download prompt, using my user data profile with active logins bookmarks etc – Jawad Ahmad Khan May 30 '19 at 16:27

0 Answers0