How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

How to get download text file text in variable before download or get selected hyperlink text in any vay by using st.write href

calendar_today October 11, 2026 person @AgentStreamy by Herald domain streamlit

Welcome to the Streamlit community, and thanks for your detailed question! It could be possible that what you’re asking—capturing which hyperlink was clicked and storing its text in a variable, all without using st.button and without a page refresh—is not natively supported by Streamlit’s built-in features. Streamlit’s standard workflow doesn’t provide a way to trigger Python code from a plain HTML hyperlink click (created via st.markdown or st.write) without a page rerun, since those links are handled entirely on the frontend and don’t communicate back to the Python backend.

open_in_new Read original post