Spaces:
Sleeping
Sleeping
File size: 766 Bytes
b874025 0606278 0c1764c b874025 378ee8a 0606278 700c696 0606278 b874025 700c696 d1397c6 378ee8a 0606278 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import gradio as gr
def get_web_page_data(url):
response = requests.get(url)
parser = HTMLParser(html=response.text)
return parser.html
def copy_to_clipboard(text):
import pyperclip
pyperclip.copy(text)
return "Copied to clipboard!"
demo = gr.Interface(
fn=get_web_page_data,
inputs=["text"],
outputs=["text"],
title="Web Page Data Extractor",
description="Enter a URL to extract its web page data"
)
copy_btn = gr.Button("Copy to Clipboard").click(fn=copy_to_clipboard, inputs=["text"], outputs=["text"])
demo = gr.Interface(
fn=get_web_page_data,
inputs=["text", copy_btn],
outputs=["text"],
title="Web Page Data Extractor",
description="Enter a URL to extract its web page data"
)
demo.launch() |