Abdallah Barghouti
Abdallah Barghouti

Reputation: 165

How to allow chrome driver to download multiple files - selenium

I have a python code that surfs multiple pages on the internet and downloads files, using selenium.
The problem is that after the first file downloaded, the chrome driver asks to allow multiple downloads, which leads to continue surfing without actually downloading any further files.
How can I prevent that from happening? using selenium or editing the chrome driverenter image description here

Upvotes: 2

Views: 4920

Answers (1)

cruisepandey
cruisepandey

Reputation: 29362

You can define below options :

chrome_options = webdriver.ChromeOptions()

prefs = {'profile.default_content_setting_values.automatic_downloads': 1}
chrome_options.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(options = chrome_options)

Upvotes: 7

Related Questions