def test_get_dict(self):
     client = GoogleSearchResults({
         "q": "Coffee",
         "location": "Austin,Texas"
     })
     data = client.get_dict()
     self.assertIsNotNone(data.get('local_results'))
Ejemplo n.º 2
0
def serpapi(query):
    params = {
        "q": query,
        "hl": "en",
        "gl": "us",
        "google_domain": "google.com",
        "api_key": "325864d0-8efc-11e9-b84e-393b768a5ed9",
    }
    client = GoogleSearchResults(params)
    results = client.get_dict()

    urllist = [x["link"] for x in results["organic_results"]]
    #extended_urllist = [ (x["link"], x["titel"]) for x in results["organic_results"]]
    #print(urllist)
    return urllist