mgokg commited on
Commit
f211c65
·
verified ·
1 Parent(s): fc28bf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -40,7 +40,9 @@ def perform_search(prompt):
40
  # HTTP GET-Anfrage an die Google Custom Search API
41
  response = requests.get(url)
42
  response.raise_for_status() # Wirft eine Exception, wenn die Anfrage fehlschlägt
43
-
 
 
44
  # JSON-Antwort parsen
45
  data = response.json()
46
 
 
40
  # HTTP GET-Anfrage an die Google Custom Search API
41
  response = requests.get(url)
42
  response.raise_for_status() # Wirft eine Exception, wenn die Anfrage fehlschlägt
43
+ soup = BeautifulSoup(response.content, 'html.parser')
44
+ response_text = soup.find('body')
45
+ return response_text.text
46
  # JSON-Antwort parsen
47
  data = response.json()
48