0

I'm using selemium chromedriver with python, and I need it to download automatically large amount of files, the problem is that chrome asks to allow multiple downloads, is there a way to block chrome from asking me that and automatically allow multiple downloads? I already saw this two for other languages: Disable chrome download multiple files confirmation, Disable chrome download multiple files confirmation however they does not work for me and it keep asking me to allow multiple downloads.

user2207686
  • 107
  • 1
  • 8

2 Answers2

1

You need to set the chrome options for the chrome driver, specifically the download.prompt_for_download option to false. See the chromedriver documentation, here is an example:

options = webdriver.ChromeOptions()
profile = { 
    "download.default_directory": "C:\tmp\whatever\", 
    "download.prompt_for_download": False
    }
options.add_experimental_option("prefs", profile)
browser = webdriver.Chrome(options=options)
AutomatedOrder
  • 501
  • 4
  • 14
-1

According to Selenium documentation they are not a solution for downloading things (https://www.selenium.dev/documentation/en/worst_practices/file_downloads/).

They do have a solution to interact with alerts and stuff (https://www.selenium.dev/documentation/en/webdriver/js_alerts_prompts_and_confirmations/).

As a possible solution you could try using Selenium in the headless mode perhaps avoiding the question in first place. I am trying it right now.

mik
  • 1
  • 1
    The selenium documentation you linked doesn't say there is not a solution, only that you can't monitor the download progress via selenium. You just have to set browser preferences to download without asking and it will work fine. – AutomatedOrder Sep 03 '20 at 14:20