Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,6 @@ def parse_content(html_content):
|
|
| 46 |
df = pd.DataFrame([parsed_data])
|
| 47 |
return df
|
| 48 |
|
| 49 |
-
# Define the Gradio interface
|
| 50 |
def process_input(html_content):
|
| 51 |
try:
|
| 52 |
df = parse_content(html_content)
|
|
@@ -54,11 +53,13 @@ def process_input(html_content):
|
|
| 54 |
except Exception as e:
|
| 55 |
return f"Error: {e}"
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
)
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
|
| 64 |
-
interface.launch()
|
|
|
|
| 46 |
df = pd.DataFrame([parsed_data])
|
| 47 |
return df
|
| 48 |
|
|
|
|
| 49 |
def process_input(html_content):
|
| 50 |
try:
|
| 51 |
df = parse_content(html_content)
|
|
|
|
| 53 |
except Exception as e:
|
| 54 |
return f"Error: {e}"
|
| 55 |
|
| 56 |
+
with gr.Blocks() as interface:
|
| 57 |
+
with gr.Column():
|
| 58 |
+
gr.Markdown("## HTML Content Parser")
|
| 59 |
+
html_input = gr.Textbox(label="Paste HTML Content", lines=10, placeholder="Paste your HTML content here...")
|
| 60 |
+
parse_button = gr.Button("Parse Content")
|
| 61 |
+
parsed_output = gr.Dataframe(label="Parsed Data")
|
| 62 |
+
|
| 63 |
+
parse_button.click(fn=process_input, inputs=html_input, outputs=parsed_output)
|
| 64 |
|
| 65 |
+
interface.launch()
|
|
|