I'm looking for any python API to search in google (normal search), and I found only the following code:
import pprint
from googleapiclient.discovery import build
def google_search(search_term, api_key, cse_id, **kwargs):
service = build("customsearch", "v1", developerKey=api_key)
res = service.cse().list(q=search_term, cx=cse_id, **kwargs).execute()
return res['items']
my_api_key = "Google_API_Key"
my_cse_id = "my_cse_id"
results = google_search('stackoverflow site:en.wikipedia.org', my_api_key, my_cse_id, num=10)
for result in results:
pprint.pprint(result)
The first thing is that it generate this error, I tried to resolve but no chance :/ : results
= self.google_searchS('stackoverflow wikipedia.org', my_api_key, my_cse_id)
TypeError: google_searchS() takes 3 positional arguments but 4 were given
The other thing is there any other API for the normal search "not custom search" .. ?