Python Google API 使用 OAuth 2 的网络爬虫
Python Google API Web Crawler using OAuth 2
我目前使用 API 键抓取 Google API。事实证明,如果我使用 OAuth,我会得到更多的请求配额。我已经在我的网站上应用了 OAuth,但我不知道如何处理从这些 OAuth 获得的令牌。我无法以某种方式轻松找到样本。看过一点点,马上就失去了。 Google API 文档的指导性不够。
如果有人能给我一个示例代码,那就太棒了。
这是我当前的代码(没有 OAuth,只有普通的 API 密钥):
import pprint
from apiclient.discovery import build
service = build('plus', 'v1', developerKey="my-api-key")
person = service.people().search(query='fransisca', language='id').execute()
pprint.pprint(person)
没关系。找到了!那个挺难。我认为Google需要重新思考自己的内容SEO。
https://www.youtube.com/watch?v=h-gBeC9Y9cE&list=PLOU2XLYxmsILOIxBRPPhgYbuSslr50KVq&index=3
请参阅视频第 2 分钟。
我目前使用 API 键抓取 Google API。事实证明,如果我使用 OAuth,我会得到更多的请求配额。我已经在我的网站上应用了 OAuth,但我不知道如何处理从这些 OAuth 获得的令牌。我无法以某种方式轻松找到样本。看过一点点,马上就失去了。 Google API 文档的指导性不够。
如果有人能给我一个示例代码,那就太棒了。
这是我当前的代码(没有 OAuth,只有普通的 API 密钥):
import pprint
from apiclient.discovery import build
service = build('plus', 'v1', developerKey="my-api-key")
person = service.people().search(query='fransisca', language='id').execute()
pprint.pprint(person)
没关系。找到了!那个挺难。我认为Google需要重新思考自己的内容SEO。
https://www.youtube.com/watch?v=h-gBeC9Y9cE&list=PLOU2XLYxmsILOIxBRPPhgYbuSslr50KVq&index=3
请参阅视频第 2 分钟。