Nipun Wijerathne
Nipun Wijerathne

Reputation: 1829

How to Save in PDF Format Selenium (Python)

I'm using selenium to automate some pdf files downloads. However, I ran into a problem where I need to click on the save button in the following pop up window.

enter image description here

I couldn't find any method to click on the save button using Selenium. Any suggestions would be greatly appreciated

Upvotes: 0

Views: 713

Answers (1)

Iron Hand Odin
Iron Hand Odin

Reputation: 430

If you use gecko driver

from selenium.webdriver.firefox.firefox_porfile import FirefoxProfile()
profile = FirefoxProfile()
# Save pdf without asking
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/pdf")

You can find other files subtitles

https://www.sitepoint.com/mime-types-complete-list/

edit: I find a similar link here:

In selenium python webdriver, I'm not able to download a text file with a .lst extension

Upvotes: 1

Related Questions