我正在遵循使用Python API连接到Linkedin的步骤。
我安装了软件包,但是当我尝试登录时:
from linkedin import linkedin
API_KEY = "################"
API_SECRET = "###############"
RETURN_URL = "http://localhost:8000"
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET,
RETURN_URL, linkedin.PERMISSIONS.enums.values())
print authentication.authorization_url
application = linkedin.LinkedInApplication(authentication)
我收到以下错误消息:
Traceback (most recent call last):
File "C:\Users\maria\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2910, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-11-c4a6e3368b44>", line 1, in <module>
from linkedin import linkedin
File "C:\Users\maria\Anaconda3\lib\site-packages\linkedin\linkedin.py", line 294
except (requests.ConnectionError, requests.HTTPError), error:
^
SyntaxError: invalid syntax
有什么想法吗?这可能是什么问题?