gpt4 book ai didi

google-custom-search - Google 自定义搜索 API - 将结果限制为每个域 1 个

转载 作者:行者123 更新时间:2023-12-01 15:16:06 25 4
gpt4 key购买 nike

有什么方法可以将 Google Custom Search API 返回的结果限制为每个域 1 个?

最佳答案

是的。如果您正在寻找第一个结果。如果您熟悉 Python,则可以尝试以下操作。

res = service.cse().list(query,cx='YOURSEARCHENGINEIDHERE,).execute()

name = res['items'][0]['title'] #title of the first search result
url = res['items'][0]['link'] #url of the first search result

关于google-custom-search - Google 自定义搜索 API - 将结果限制为每个域 1 个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30266770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com