Reputation: 311
I've seen many posts regarding this but all of them in firefox, none of them helps with Chrome. I wanna get access to this download popup window:
Ideally, I'd like to set the download name from the script and then click the save button. But setting the chromedriver to ignore the download dialog and save the images automatically will work as well
Any help will be appreciated
Upvotes: 1
Views: 2043
Reputation: 596
I don't believe you will be able to accomplish this with a python selenium script. The download dialog box is rendered by the browser so you won't be able to target it with HTML.
Alternatively, you can turn off the "download dialog" option in settings that asks you where to save and have it save directly to a directory of your choice and then use python's os
module in your script to rename the file.
So if you are saving some file to /tmp
for example, then you could do the following in your script after the file has been downloaded:
os.rename("/tmp/my_downloaded_file", "/tmp/my_new_name")
Upvotes: 1