我想用pythonscrip在linkedin上分享帖子

2024-09-29 17:16:31 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我想分享我在linkedin上的帖子,我尝试了很多脚本,但是得到了授权错误“你必须通过身份验证才能访问这个页面”

import oauth2
import oauth2 as oauth, urllib
import requests
import urllib


API_KEY = 'xxxxxxxxxxxxx'
API_SECRET = 'xxxxxxxxxxx'

param = {'response_type':'code', 'client_id':'xxxxxxxxxxx', 'redirect_uri':'http://localhost:8069', 'state':'987654321'}

file_one = requests.post('https://www.linkedin.com/oauth/v2/authorization?', params = param)
print "access token info file",file_one
print "access token info file.text",file_one.text

它会返回类似“您必须通过身份验证才能访问此页”的错误,我该怎么做 我也想在谷歌加上同样的


Tags: import身份验证apiaccessparam错误urllibrequests

热门问题