如何使用python请求从网页中获取授权令牌,我曾使用请求basicAuth登录,它是工作的,但后续页面不能访问basicAuth,它返回"Authuser is not validated“。有一个登录url,我已经使用pythonrequests的basicAuth成功登录了。然后,后续页面不接受basicAuth凭证,但它需要authorization头。
from google.auth.transport import requestsfrom google.auth.transport.requestsCREDENTIALS_KEY_PATH = 'my-local-service-account-key-file.json'
#the example service url I am trying to hit with request