好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

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

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)
"""
东北大学校园网联网代码
"""

查看更多关于东北大学 python模拟登录校园网的详细内容...

  阅读:30次