要求:从我的网页用户可以添加网站并获取具有输入搜索字词的网页集合。
我们一直使用CSE V1 API通过使用 cref 参数在所需网站上根据搜索词提取网页。由于Google停止支持Link CSE功能(https://customsearch.googleblog.com/2017/02/refocusing-and-looking-forward-on.html),如何实施动态网站搜索功能?
先谢谢, Raghu
答案 0 :(得分:0)
On further analysis, custom site search is possible with the siteSearch parameter. Ref: https://developers.google.com/custom-search/json-api/v1/reference/cse/list#siteSearch. This parameter accepts only one website as the value, so for multiple website searches, invoke the Google CSE API multiple times for each website.
While creating the search engine, select the option "Search the entire web but emphasise included sites" so that you can hook websites while invoking the CSE API.
To enable siteSearch parameter of API
Hope it helps.
-Raghu