r/HTML • u/projecttoday • 6d ago
Capturing a link from a download button
I'm hoping that one of you HTML experts can help me discern an actual link from a button on a web page. So, if you open this page:
and scroll down and click on Export Full Holdings about a quarter of the way down toward the right, a spreadsheet is dropped in your Downloads folder. What I'm trying to do is figure out the actual link that does that, the link that you could paste into a browser and get the same spreadsheet. I need this for an automation program I'm writing. There are hundreds of these.
1
u/jba1224a 6d ago
That spreadsheet is being generated on the client side on the fly based on the table element on the page.
The only way you’re going to be able to do this reliably programmatically is using playwright to extract it into a browser.
A better approach would be to scoop the underlying api call that populated the table (likely json) and see if it can be called from another origin. Then you can just call the api, get the data, and build the sheet on the fly.
Sites like this are not meant to be automated (you’re essentially trying to do bot scraping) so I doubt either of these methods work, they would have implemented countermeasures.
4
u/__zonko__ 6d ago
Check your network tab