How can I log in to facebook using python (requests/urllib3)?

萝らか妹 提交于 2019-12-10 10:54:41

问题


Im trying to use http://docs.python-requests.org/en/latest/ to log into facebook automatically.

s = requests.session()
params = {'email':'MYEMAILHERE','pass':'MYPASSHERE'}
r = s.post("https://www.facebook.com/login.php/", params = params)

print r.text

But instead of fb showing me the home page it shows the me the "your cookies are disabled"... page.


回答1:


Michael Heimlich made a project for integrating with the Facebook API using python-requests:

https://github.com/michaelhelmick/requests-facebook

Still waiting for the proper REST integration though.

There is also FacePy: https://github.com/jgorset/facepy



来源:https://stackoverflow.com/questions/11472148/how-can-i-log-in-to-facebook-using-python-requests-urllib3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!