Spaces:
Runtime error
Runtime error
Dustin Haring
commited on
Commit
·
ff40c52
1
Parent(s):
d06dc73
google custom search: changed string returned if no results for og:description
Browse files- google_custom_search.py +2 -1
google_custom_search.py
CHANGED
@@ -32,7 +32,8 @@ def custom_google_search(search_term, api_key="AIzaSyA4oDDFtPxAfmPC8EcfQrkByb9xK
|
|
32 |
extended_title = "* '" + item['pagemap']['metatags'][0]['og:description'] + "'\n"
|
33 |
except:
|
34 |
# extended_title = item['title']
|
35 |
-
extended_title = "- '" + item['title'] + "'\n"
|
|
|
36 |
|
37 |
# pprint.pprint(f"dah=={item['pagemap']['metatags'][0]['og:description']}")
|
38 |
search_result_titles.append(extended_title)
|
|
|
32 |
extended_title = "* '" + item['pagemap']['metatags'][0]['og:description'] + "'\n"
|
33 |
except:
|
34 |
# extended_title = item['title']
|
35 |
+
# extended_title = "- '" + item['title'] + "'\n"
|
36 |
+
extended_title = "- No Results"
|
37 |
|
38 |
# pprint.pprint(f"dah=={item['pagemap']['metatags'][0]['og:description']}")
|
39 |
search_result_titles.append(extended_title)
|