来自Google搜索的访问代码段

时间:2017-12-25 18:52:12

标签: python json python-3.x

我使用Google的自定义搜索API从网络上获取搜索结果。我想要的只是从结果中获取片段并将它们放入列表中。我很确定它是一个JSON响应,但我不知道如何处理或解析它,文档似乎在我脑海中。到目前为止,这是我的代码。怎么办?

import pprint
from apiclient.discovery import build

service = build("customsearch", "v1", 
                developerKey="----------")

res = service.cse().list(
    q='what was the most downloaded android app of 2008',
    cx='-------------my custom engine--------------',
    googlehost='google.com',
    ).execute()

pprint.pprint(res)

0 个答案:

没有答案
相关问题