1

Basically I have a list of urls, I want to automatically pass into an iframe src, for it to process and view it. How to do that?

example :

urls_arr=['xyz.com','ybk.com']
 for i in urls_arr:
   st.markdown(<iframe src=i></iframe>)

basically i am running an app in streamlit and i am using it to embed power bi reports. the urls are actually the report embed urls.

example :

urls_arr=['xyz.com','ybk.com']
 for i in urls_arr:
   st.markdown(<iframe src=i></iframe>)

reports not opening

1 Answer 1

1

You should wrap the markdown in an f-string and add unsafe_allow_html=True. something like:

urls_arr=['xyz.com','ybk.com']
for i in urls_arr:
    st.markdown(f"<iframe src='{i}'></iframe>", unsafe_allow_html=True)

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.