有什么方法可以将 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/