How can I embed google results?

Hello good time

Friends, how can I embed google results?
I could not do this with iframe

Hi there,

Thanks for sharing your question with the community! Check out our guidelines on how to post an effective question here – in particular, please share a code snippet that shows what you’ve tried so far to implement this.

Caroline :balloon:

import streamlit as st
import streamlit.components.v1 as components

components.iframe(β€œhttp://www.google.com/”)

import streamlit as st
import streamlit.components.v1 as components

search = st.text_input("What do you want to search for?")
components.iframe(f"https://www.google.com/search?igu=1&ei=&q={search}", height=1000)

This results in something like this:

3 Likes

Hello
Thank you very much for your help.

Hello again
I have another question.
Is it possible to use two iframes side by side?
I mean to have two iframes across the page

Hi @amiran :wave:

That is certainly possible using st.columns :smile:

import streamlit.components.v1 as components
import streamlit as st

st.set_page_config(layout="wide")

search = st.text_input("What do you want to search for?")

col1, col2 = st.columns(2)

with col1:
    components.iframe(
        f"https://www.google.com/search?igu=1&ei=&q={search}", height=1000, width=400
    )

with col2:
    components.iframe(
        f"https://www.google.com/search?igu=1&ei=&q={search}", height=1000, width=400
    )

1 Like

Hello
Thank you very much, right?
I had completely forgotten the columns

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.