Spaces:
Sleeping
Sleeping
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() |