mgokg commited on
Commit
4a937f9
·
verified ·
1 Parent(s): a72431f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -33,15 +33,13 @@ def get_impressum_text(search_term):
33
  if 'items' in search_results:
34
  for item in search_results['items']:
35
  link = item['link']
36
- response = requests.get(link, timeout=5) # Timeout hinzugefügt für Fehlerbehandlung
37
- response.raise_for_status() # Wirft eine Exception, wenn der Statuscode nicht 200 ist
38
- soup = BeautifulSoup(response.content, 'html.parser')
39
-
40
- impressum_div = soup.find('div', class_='MjjYud')
41
-
42
- return impressum_div.text.strip()
43
 
 
44
 
 
45
 
46
  def websearch(prompt):
47
 
 
33
  if 'items' in search_results:
34
  for item in search_results['items']:
35
  link = item['link']
36
+ response = requests.get(link, timeout=5) # Timeout hinzugefügt für Fehlerbehandlung
37
+ response.raise_for_status() # Wirft eine Exception, wenn der Statuscode nicht 200 ist
38
+ soup = BeautifulSoup(response.content, 'html.parser')
 
 
 
 
39
 
40
+ impressum_div = soup.find('div', class_='MjjYud')
41
 
42
+ return impressum_div.text.strip()
43
 
44
  def websearch(prompt):
45