Du Mingzhe
commited on
Commit
•
634fbad
1
Parent(s):
35efc6a
Update
Browse files- components.py +12 -1
components.py
CHANGED
@@ -150,4 +150,15 @@ class WebSearcher(object):
|
|
150 |
response = requests.get("https://api.bing.microsoft.com/v7.0/search", headers=headers, params=params)
|
151 |
response.raise_for_status()
|
152 |
search_results = response.json()
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
response = requests.get("https://api.bing.microsoft.com/v7.0/search", headers=headers, params=params)
|
151 |
response.raise_for_status()
|
152 |
search_results = response.json()
|
153 |
+
|
154 |
+
filter_results = list()
|
155 |
+
|
156 |
+
for result in search_results['webPages']['value']:
|
157 |
+
filter_results += [{
|
158 |
+
'name': result['name'],
|
159 |
+
'url': result['url'],
|
160 |
+
'snippet': result['snippet'],
|
161 |
+
'dateLastCrawled': result['dateLastCrawled'],
|
162 |
+
}]
|
163 |
+
|
164 |
+
return filter_results
|