How to automatically download a web page file with a download button without using BeautifulSoup?
P粉762730205
P粉762730205 2023-08-30 18:19:18
0
1
468
<p>I have created a Streamlit application which has a download button for downloading CSV files. I want to automatically download content using "GET" or "POST" requests. Is there any way to do this? </p> <p>This is my application URL: https://maalaei97-test2.hf.space/?__theme=light</p> <p>I tried using urllib2.Request("GET", URL) but I received None. I should mention that since I'm using a python script in a software that only supports Iron Python, I don't have access to libraries like Beautifulsoap and requests. But I have access to urllib2 and webbrowser libraries. </p>
P粉762730205
P粉762730205

reply all(1)
P粉546179835

I've checked your site and it uses JavaScript to open a new window on that button and download your CSV file. In your case the actual URL is:

https://maalaei97-test2.hf.space/media/c721b14394345aab14989004e9ce8a3bae6fbb02a8e8d6a41a4f5401.csv?title=app%20%C2%B7%20Streamlit

I think you can download it using urllib and GET requests. If you want to click the link using Python, you need to run the JavaScript code.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template