无法通过python进行身份验证

时间:2016-12-08 21:50:49

标签: python post python-requests

输出文件显示POST请求正常但网站仍需要授权:

      import requests
      import sys
      def main():
          session = requests.session(config={'verbose': sys.stderr})

            login_data = {
            'email': 'PHONE_OR_LOGIN',
            'pass': 'PASSWORD',
            }

     r = session.post('http://vk.com/login', data=login_data)

     text_file = open("save.html", "w")
     text_file.write(r.content)
     text_file.close()
     print r.content

 if __name__ == '__main__':
    main()

0 个答案:

没有答案