File size: 419 Bytes
1b92abf
 
 
 
 
0b90961
1b92abf
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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):