加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

东北大学 python模拟登录校园网

发布时间:2020-12-20 10:50:54 所属栏目:Python 来源:网络整理
导读:import reimport requestsurl="http://ipgw.neu.edu.cn/srun_cas.php?ac_id=1"head={ "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/49.0.2623.87 Safari/537.36",}sess=requests.session()req=sess.ge
import re
import requests
url="http://ipgw.neu.edu.cn/srun_cas.php?ac_id=1"
head={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/49.0.2623.87 Safari/537.36",}
sess=requests.session()
req=sess.get(url,headers=head)

lt_execution_id=re.findall(‘name="lt" value="(.*?)".*sname="execution" value="(.*?)"‘,req.text,re.S)

payload={
    "rsa":"1771482luck0821luck"+lt_execution_id[0][0],"ul":"7","pl":"12","lt":lt_execution_id[0][0],"execution":lt_execution_id[0][1],"_eventId":"submit"
}
r2=sess.post("https://pass.neu.edu.cn/tpass/login?service=https%3A%2F%2Fipgw.neu.edu.cn%2Fsrun_cas.php%3Fac_id%3D3",headers=head,data=payload)
print(r2.text)
"""
东北大学校园网联网代码
"""

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读