Spaces:
Sleeping
Sleeping
Commit
·
b5894f9
1
Parent(s):
99d880b
fix
Browse files
app.py
CHANGED
|
@@ -16,19 +16,27 @@ def export_csv(domain):
|
|
| 16 |
df.to_csv(tmp.name, index=False)
|
| 17 |
return tmp.name
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
demo.launch()
|
|
|
|
| 16 |
df.to_csv(tmp.name, index=False)
|
| 17 |
return tmp.name
|
| 18 |
|
| 19 |
+
# Create the two interfaces
|
| 20 |
+
email_interface = gr.Interface(
|
| 21 |
+
fn=extract_emails,
|
| 22 |
+
inputs=gr.Textbox(label="Enter Domain"),
|
| 23 |
+
outputs=gr.Textbox(label="Extracted Emails", lines=10),
|
| 24 |
+
title="📧 Email Extractor",
|
| 25 |
+
description="Scrapes and extracts emails from a domain."
|
| 26 |
+
)
|
| 27 |
|
| 28 |
+
csv_interface = gr.Interface(
|
| 29 |
+
fn=export_csv,
|
| 30 |
+
inputs=gr.Textbox(label="Enter Domain"),
|
| 31 |
+
outputs=gr.File(label="Download CSV"),
|
| 32 |
+
title="📥 CSV Exporter",
|
| 33 |
+
description="Download extracted emails as a CSV file."
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
# Combine into tabbed interface
|
| 37 |
+
demo = gr.TabbedInterface(
|
| 38 |
+
[email_interface, csv_interface],
|
| 39 |
+
tab_names=["Extract Emails", "Download CSV"]
|
| 40 |
+
)
|
| 41 |
|
| 42 |
demo.launch()
|