私は死んで迷っています:)
目標は、OAuth2 を使用する Web サイトにログオンすることです。ただし、実行する必要があるセクションには、API が関連付けられていません。そのため、ユーザー名とパスワードを使用してログインし、問題のページに移動してスクリーン スクレイプを実行してデータを取得する必要があります。
このキーボードに座っている Web サイトに問題があるのではないと確信しています。しかし、私は例を検索し、たくさんの推測を試みましたが、何も機能していません
助けはありがたく受け入れられます。
import sys
import requests
import oauth2 as oauth
r = requests.get(logon_url)
consumer = oauth.Consumer(key=user, secret=password)
client = oauth.Client(consumer)
resp, content = client.request(r.url, "GET")
token_url = resp['content-location']
# At this point i'm lost i'm just guessing on the rest
# the next doesn't give an error but i'm sure it's wrong
resp2, content2 = client.request(token_url, 'GET')
# save the cookie, i do have a cookie but not sure what i have
auth_token = resp['set-cookie']