Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,11 +22,6 @@ custom_css = """
|
|
22 |
}
|
23 |
"""
|
24 |
|
25 |
-
def google_search(search_term, **kwargs):
|
26 |
-
service = build("customsearch", "v1", developerKey=apikey) # Ersetze YOUR_GOOGLE_API_KEY mit deinem API-Key
|
27 |
-
res = service.cse().list(q=search_term, cx="77f1602c0ff764edb", **kwargs).execute() # Ersetze YOUR_CUSTOM_SEARCH_ENGINE_ID mit deiner Custom Search Engine ID
|
28 |
-
return res
|
29 |
-
|
30 |
def get_impressum_text(search_term):
|
31 |
|
32 |
headers = {
|
@@ -34,7 +29,7 @@ def get_impressum_text(search_term):
|
|
34 |
}
|
35 |
|
36 |
#search_results = google_search(search_term)
|
37 |
-
url = f"https://google.com/
|
38 |
response = requests.get(url, headers=headers)
|
39 |
soup = BeautifulSoup(response.content, 'html.parser')
|
40 |
impressum_div = soup.find('body')
|
|
|
22 |
}
|
23 |
"""
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
def get_impressum_text(search_term):
|
26 |
|
27 |
headers = {
|
|
|
29 |
}
|
30 |
|
31 |
#search_results = google_search(search_term)
|
32 |
+
url = f"https://cse.google.com/cse?cx=77f1602c0ff764edb&q=impressum {search_term}"
|
33 |
response = requests.get(url, headers=headers)
|
34 |
soup = BeautifulSoup(response.content, 'html.parser')
|
35 |
impressum_div = soup.find('body')
|