mgokg commited on
Commit
b66ac54
·
verified ·
1 Parent(s): a28a8aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -11
app.py CHANGED
@@ -4,6 +4,8 @@ from bs4 import BeautifulSoup
4
  from urllib.parse import urljoin
5
  from gradio_client import Client
6
 
 
 
7
  def parse_links_and_content(ort):
8
  base_url = "https://vereine-in-deutschland.net"
9
  all_links = []
@@ -57,15 +59,17 @@ def parse_links_and_content(ort):
57
  #return filtered_data
58
 
59
  def scrape_links(links):
60
-
61
- client = Client("mgokg/PerplexicaApi")
62
-
63
- result = client.predict(
64
- prompt="contact details Aero Club Bamberg e.v.",
65
- api_name="/parse_links"
66
- )
67
- print(result)
68
- return result
 
 
69
 
70
  # Erstelle die Gradio-Schnittstelle
71
  with gr.Blocks() as demo:
@@ -77,8 +81,9 @@ with gr.Blocks() as demo:
77
 
78
  def process_ort(ort):
79
  links = parse_links_and_content(ort)
80
- #scraped_content = scrape_links(links)
81
- return links
 
82
 
83
  # Button zum Starten der Parsung
84
  button = gr.Button("senden")
 
4
  from urllib.parse import urljoin
5
  from gradio_client import Client
6
 
7
+ client = Client("mgokg/PerplexicaApi")
8
+
9
  def parse_links_and_content(ort):
10
  base_url = "https://vereine-in-deutschland.net"
11
  all_links = []
 
59
  #return filtered_data
60
 
61
  def scrape_links(links):
62
+ links=links
63
+ contact_details= []
64
+ for verein in links:
65
+ result = client.predict(
66
+ prompt=f"{verein}",
67
+ api_name="/parse_links"
68
+ )
69
+ #print(result)
70
+ contact_details.append(result)
71
+
72
+ return contact_details
73
 
74
  # Erstelle die Gradio-Schnittstelle
75
  with gr.Blocks() as demo:
 
81
 
82
  def process_ort(ort):
83
  links = parse_links_and_content(ort)
84
+ contact= scrape_links(links)
85
+ return contact
86
+ #return links
87
 
88
  # Button zum Starten der Parsung
89
  button = gr.Button("senden")