google_search.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:PyQYT 作者: collinsctk 项目源码 文件源码
def google_search(key_word):

    service = build("customsearch", "v1",
                 developerKey="??KEY")

    res = service.cse().list(
         q=key_word,
         cx='????ID',
         num=10, #Valid values are integers between 1 and 10, inclusive.
    ).execute() 

    for value in res:
        #print(value)
        if 'items' in value:
            for results in res[value]:
                #print(results)
                print(results['formattedUrl'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号