求一段模拟登录的程序

rypan 2016-11-01 05:03:33
能登录进http://cn.morningstar.com

请优先使用requests和beautifutsoup模块

多谢!
...全文
308 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
手无护鸡之力 2016-12-02
  • 打赏
  • 举报
回复

        import requests
        headers = {"Content-Type": "Application/JSON"}
        auth = {"username":  “user", "password": "pass"}
        auth_json = json.dumps(auth)

        url = "http://cn.morningstar.com"

        s = requests.Session()
        s.post(url, data=auth_json, headers=headers)

37,721

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧