【发布时间】:2016-07-21 14:34:33
【问题描述】:
我正在尝试使用来自https://github.com/tristantao/py-bing-search 的 PyBingSearch 模块来使用 Bing API 返回搜索结果。在 github 页面中,他们有一个如何使用它的示例。
from py_bing_search import PyBingWebSearch
search_term = "Python Software Foundation"
bing_web = PyBingWebSearch('Your-Api-Key-Here', search_term, web_only=False) # web_only is optional, but should be true to use your web only quota instead of your all purpose quota
first_fifty_result= bing_web.search(limit=50, format='json') #1-50
当我尝试运行声明 first_fifity_result 的行时,我收到一条错误声明 Request returned with code 401, error msg: The authorization type you provided is not supported. Only Basic and OAuth are supported
为什么会出现此错误?在我的代码中,我确保将 Your-Api-Key-Here 更改为我的 API 密钥。
【问题讨论】: