Spaces:
Sleeping
Sleeping
from proxy import getProxy | |
from searchlib import search as googlesearch | |
def search(query): | |
results = {} | |
counter = 0 | |
for searchObj in googlesearch(query, advanced=True, proxy=getProxy()): | |
newObj = { | |
"title": searchObj.title, | |
"description": searchObj.description, | |
"url": searchObj.url | |
} | |
results[counter] = newObj | |
counter = counter + 1 | |
return results | |
def test_search(): | |
query = "python programming" | |
results = search(query) | |
return results | |
# print(test_search()) | |