mgokg commited on
Commit
99c69ca
·
verified ·
1 Parent(s): 3821caa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -4
app.py CHANGED
@@ -93,16 +93,28 @@ def process_ort(ort):
93
  links_text = list_of_clubs(ort)
94
  vereine = []
95
  for verein in links_text:
96
- query = f"impressum {verein}"
 
 
 
 
 
 
 
 
 
 
 
97
  #uri = f"https://www.google.com/search?q={query}"
98
  #response = requests.get(uri)
99
  #soup = BeautifulSoup(response.text, 'html.parser')
100
  #first_div = soup.find('body')
101
  #erg = llm(first_div.text)
102
  #return first_div.text
103
- contact_detailes = google_search(query)
104
- json_object = llm(contact_detailes)
105
- vereine.append(json_object)
 
106
  #vereine.extend(json_object)
107
 
108
  return vereine
 
93
  links_text = list_of_clubs(ort)
94
  vereine = []
95
  for verein in links_text:
96
+ #query = f"impressum {verein}"
97
+
98
+ headers = {
99
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
100
+ }
101
+
102
+ #search_results = google_search(search_term)
103
+ url = f"https://www.google.com/search?q=impressum {search_term}"
104
+ response = requests.get(url, headers=headers)
105
+ soup = BeautifulSoup(response.content, 'html.parser')
106
+ impressum_div = soup.find('body')
107
+ #return impressum_div.text
108
  #uri = f"https://www.google.com/search?q={query}"
109
  #response = requests.get(uri)
110
  #soup = BeautifulSoup(response.text, 'html.parser')
111
  #first_div = soup.find('body')
112
  #erg = llm(first_div.text)
113
  #return first_div.text
114
+ contact_detailes = impressum_div.text
115
+ #json_object = llm(contact_detailes)
116
+ vereine.append(contact_detailes)
117
+ #vereine.append(json_object)
118
  #vereine.extend(json_object)
119
 
120
  return vereine