Download Files with Python using a submit Button

Viewed 428

As the title implies, I would like to use Python to download a file using a submit button. In my example its a pdf file from Wikipedia.

It's easy to find answers on how to download files from URLs ending with .png or something. I wasn't able to find much about my specific problem though.

A sample page would look like this. By clicking the button the download starts and the file is saved to your Downloads folder. How can I realize this process with Python? I tried different packages like requests, bs4 or urllib.

I do not want to solve the problem by using pyautogui or something to literally 'click' the button by using its position on the screen, I'd rather have a solution that is able to operate in the background.

Thanks for your help

1 Answers

Use Selenium and then click on download button with code

Related