Reputation: 11
I'm trying to download a .xls from this Site
I need to somehow click on the second button("Exporta informácion diária") on the grid and download the .xls file.
I tried with requests
and beautifulsoup
but didnt work.
After that, tried with selenium
just for some tests and i managed to do what i needed.
Can someone please explain how can i download the .xls file without using a headless browser?
Thank You.
Upvotes: 1
Views: 326
Reputation: 161
To do this, you first need to understand what the flow of network requests that performs the download. The easiest way is to open the developer tools in the browser you are using. And follow the appropriate requests.
In your case, there is an POST Request, Which returns the exact address to the file. Download it with a GET request.
Upvotes: 1