Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97762

How do I automatically download files from a pop up dialog using selenium-python

$
0
0

I am trying to automatically download files from a pop up dialog using selenium-python.

The firefox popups look like this

enter image description here

I want to simulate clicking "OK"

I found this answer How do I trap a popup in Selenium 2 python which sent me to the docs https://selenium-python.readthedocs.org/en/latest/navigating.html?highlight=popup#popup-dialogs

I've tried this

    alert = driver.switch_to_alert()
    #alert.send_keys(Keys.RETURN) #No alert is present

and this

    alert = driver.switch_to_alert()
    alert.accept()  #no alert is present

If I run pprint.pprint(driver.window_handles) it prints only a single GUID -- showing that only one window is present.

So if no alert is present and there is only one window -- how do I download these files?


Viewing all articles
Browse latest Browse all 97762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>