我可以仅使用被阻止的页面来获得 Bing 自定义搜索结果吗?
Can I get Bing custom search results utilizing only blocked pages?
在我的 Bing 自定义搜索引擎中,我有一个空的活动列表,并且我的阻止列表中有几个站点。我想查看所有网络结果减去我的阻止列表,但我这样得到的结果为零。我有办法做到这一点吗?
编辑:已解决。请参阅下面的代码
注意:我使用 Bing 网络搜索 API 支持自定义搜索来获得我想要的结果。
# code solution, I was able to get my desired results and
# exclude a large number of websites with this method
# I can confirm that at least 20 stacked exclusions are working with no issues.
def bing_search(key,url,term):
headers = {"Ocp-Apim-Subscription-Key" : subscription_key}
params = {"q": bterm, "textDecorations":True, "textFormat":"HTML"}
response = requests.get(search_url, headers=headers, params=params)
response.raise_for_status()
search_results = response.json()
results = bing_search(subscription_key, search_url, (str(each) +
"-site:facebook.com "
"-site:yellowpages.com "
"-site:yelp.com "
"-site:local.yahoo.com "
"-site:manta.com "
"-site:searchonamerica.com "
"-site:wellness.com "
"-site:countyoffice.org "
"-site:buzzfile.com "
"-site:superpages.com "
"-site:dandb.com "
"-site:finduslocal.com "
"-site:chamberofcommerce.com "
"-site:whitepages.com "
"-site:businessfinder.nola.com "
"-site:yellowbook.com "
"-site:bizapedia.com "
"-site:bbb.org "
"-site:mapquest.com "
"-site:infofree.com "))
希望以后自定义搜索引擎能支持这个功能。
如果被阻止的站点列表很小,您可以使用 Bing 网络搜索 api。您可以使用 -site:www.xyz.com 作为查询参数。这是 link 到 API:https://azure.microsoft.com/en-us/services/cognitive-services/bing-web-search-api/.
在我的 Bing 自定义搜索引擎中,我有一个空的活动列表,并且我的阻止列表中有几个站点。我想查看所有网络结果减去我的阻止列表,但我这样得到的结果为零。我有办法做到这一点吗?
编辑:已解决。请参阅下面的代码 注意:我使用 Bing 网络搜索 API 支持自定义搜索来获得我想要的结果。
# code solution, I was able to get my desired results and
# exclude a large number of websites with this method
# I can confirm that at least 20 stacked exclusions are working with no issues.
def bing_search(key,url,term):
headers = {"Ocp-Apim-Subscription-Key" : subscription_key}
params = {"q": bterm, "textDecorations":True, "textFormat":"HTML"}
response = requests.get(search_url, headers=headers, params=params)
response.raise_for_status()
search_results = response.json()
results = bing_search(subscription_key, search_url, (str(each) +
"-site:facebook.com "
"-site:yellowpages.com "
"-site:yelp.com "
"-site:local.yahoo.com "
"-site:manta.com "
"-site:searchonamerica.com "
"-site:wellness.com "
"-site:countyoffice.org "
"-site:buzzfile.com "
"-site:superpages.com "
"-site:dandb.com "
"-site:finduslocal.com "
"-site:chamberofcommerce.com "
"-site:whitepages.com "
"-site:businessfinder.nola.com "
"-site:yellowbook.com "
"-site:bizapedia.com "
"-site:bbb.org "
"-site:mapquest.com "
"-site:infofree.com "))
希望以后自定义搜索引擎能支持这个功能。
如果被阻止的站点列表很小,您可以使用 Bing 网络搜索 api。您可以使用 -site:www.xyz.com 作为查询参数。这是 link 到 API:https://azure.microsoft.com/en-us/services/cognitive-services/bing-web-search-api/.