Spaces:
Running
Running
Update app.py
Browse files
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 |
|