+1 vote
1 view
in Devops and Agile by (25k points)

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:

enter image description here

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

1 Answer

0 votes
by (63.3k points)

I  don't think 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") 

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...