Spaces:
Runtime error
Runtime error
hellorahulk
commited on
Commit
•
8894aa7
1
Parent(s):
99cb037
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import gradio as gr
|
3 |
+
from steps.Bots import CompetitorBot
|
4 |
+
from steps.parse_website import ParseLink
|
5 |
+
|
6 |
+
def f(company_name: str):
|
7 |
+
|
8 |
+
# Load the input data
|
9 |
+
website,html = CompetitorBot().target_html(company_name)
|
10 |
+
|
11 |
+
#Parse Website
|
12 |
+
html_tables = ParseLink(website,html).parse()
|
13 |
+
|
14 |
+
return html_tables
|
15 |
+
|
16 |
+
outputs = [
|
17 |
+
gr.Dataframe(),
|
18 |
+
]
|
19 |
+
|
20 |
+
# Create the Gradio app
|
21 |
+
iface = gr.Interface(fn=f, inputs="text", outputs=outputs, title="Competitor bot")
|
22 |
+
iface.launch(share=True,debug=True)
|