How to automatically download a web page file with a download button without using BeautifulSoup?
P粉762730205
2023-08-30 18:19:18
<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>
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:
I think you can download it using
urllib
andGET
requests. If you want to click the link using Python, you need to run the JavaScript code.