zanegraper commited on
Commit
b5894f9
·
1 Parent(s): 99d880b
Files changed (1) hide show
  1. app.py +21 -13
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
- with gr.TabbedInterface(["Extract Emails", "Download CSV"]) as demo:
20
- with gr.Tab("Extract Emails"):
21
- gr.Interface(
22
- fn=extract_emails,
23
- inputs=gr.Textbox(label="Enter Domain"),
24
- outputs=gr.Textbox(label="Extracted Emails", lines=10)
25
- )
 
26
 
27
- with gr.Tab("Download CSV"):
28
- gr.Interface(
29
- fn=export_csv,
30
- inputs=gr.Textbox(label="Enter Domain Again"),
31
- outputs=gr.File(label="Download CSV")
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()