Continuing the discussion from A new tab doesn't open up in my web-browser if I run the streamlit-python script:
Hi @thiago I’m having a similar issue using the
webbrowser package. When I test it locally, it works as expected and the new tab opens. However, it does not open in the deployed version.
Any ideas why this might be happening?
if st.button('💭 Share Feedback', use_container_width=True):
url_feedback = "https://docs.google.com/forms/..."
webbrowser can open a browser only in the same computer it is running, not in a different computer.
There’s a related conversation here and from this conversation I proposed a tweak as follows:
The following code will open a new page upon clicking on the button:
import streamlit as st
from streamlit.components.v1 import html
""" % (url)
st.button('Open link', on_click=open_page, args=('https://streamlit.io',))
Hope this helps!
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.