Summary
Hello everybody!
I have an streamlit website that works really well, but I have to embed another website inside the sidebar using an iframe, so I use this code:
Steps to reproduce
Code snippet:
st.sidebar.markdown(f'<iframe src="https://www.meteoblue.com/en/weather/week/albuquerque_united-states_5454711/"></iframe>', unsafe_allow_html=True)
Expected behavior:
Because the external website updates everyday, I would like to see an updated iframe every day… But right now I see yesterday’s page inside the iframe.
If I open streamlit on a private/incognito window in any browser the iframe is updated, but that’s not an option, since everybody would need to login again.
Another way is (on Chrome) to right-click inside the iFrame and select ‘Reload frame’ from the context menu but the final user won’t even know that is needed.
This behavior happens at least in Chrome and Firefox.
Is there a way to update the website everytime I open it? Maybe some code to force update the iframe of the external page? a way to auto refresh an iframe inside streamlit after certain period?
Actual behavior:
The embed website (iframe) doesn’t refresh by itself, unless you use an incognito window or right-click on the iframe and select reload form the context menu.
P.S. in stack overflow they have this solution:
<script>
window.setInterval("reloadIFrame();", 3000);
function reloadIFrame() {
document.frames["frameNameHere"].location.reload();
}
</script>
But since we’re inside streamlit, is there a way to implement something like this?