| import gradio as gr | |
| import requests | |
| def greet(name): | |
| x = requests.get('https://w3schools.com/python/demopage.htm') | |
| return x.text | |
| with gr.Blocks() as demo: | |
| name = gr.Textbox(label="Name") | |
| output = gr.Textbox(label="Output Box") | |
| greet_btn = gr.Button("Greet") | |
| greet_btn.click(fn=greet, inputs=name, outputs=output) | |
| demo.launch() | |
| #print the response text (the content of the requested file): | |