Reputation: 165
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 driver
Upvotes: 2
Views: 4920
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