again
This commit is contained in:
parent
f4e74f1f8b
commit
063bea9978
@ -5,25 +5,6 @@ import base64
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
||||||
def addphonenumber():
|
|
||||||
return '''
|
|
||||||
<html>
|
|
||||||
<head align="center">
|
|
||||||
<p>请输入手机号</p>
|
|
||||||
<p>教务新要求,需要绑定手机</p>
|
|
||||||
<p>如果不放心,可以登录教务查看</p>
|
|
||||||
<p>谢谢</p>
|
|
||||||
</head>
|
|
||||||
<body align="center">
|
|
||||||
<input type="text" value="输入手机号"/>
|
|
||||||
<button>确定</button>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def connection(username,password,phone):
|
def connection(username,password,phone):
|
||||||
s = requests.Session()
|
s = requests.Session()
|
||||||
# 获取统一身份系统的网页
|
# 获取统一身份系统的网页
|
||||||
@ -49,9 +30,7 @@ def connection(username,password,phone):
|
|||||||
'_eventId': 'submit',
|
'_eventId': 'submit',
|
||||||
'submit': '提交'
|
'submit': '提交'
|
||||||
}
|
}
|
||||||
print(execution)
|
|
||||||
r = s.post(url="http://mysso-cust-edu-cn-s.webvpn.cust.edu.cn:8118/cas/login?service=https%3A%2F%2Fwebvpn.cust.edu.cn%2Fauth%2Fcas_validate%3Fentry_id%3D1",data=formdata)
|
r = s.post(url="http://mysso-cust-edu-cn-s.webvpn.cust.edu.cn:8118/cas/login?service=https%3A%2F%2Fwebvpn.cust.edu.cn%2Fauth%2Fcas_validate%3Fentry_id%3D1",data=formdata)
|
||||||
print(r.text)
|
|
||||||
r = s.get(url='http://portal-cust-edu-cn-s.webvpn.cust.edu.cn:8118/custp/index')
|
r = s.get(url='http://portal-cust-edu-cn-s.webvpn.cust.edu.cn:8118/custp/index')
|
||||||
soup=BeautifulSoup(r.text,'html.parser')
|
soup=BeautifulSoup(r.text,'html.parser')
|
||||||
try:
|
try:
|
||||||
@ -68,7 +47,6 @@ def connection(username,password,phone):
|
|||||||
data = json.loads(r.content.decode('utf-8'))
|
data = json.loads(r.content.decode('utf-8'))
|
||||||
student_name = data['data']['StudentDto']['XM']
|
student_name = data['data']['StudentDto']['XM']
|
||||||
student_id = data['data']['StudentDto']['XH']
|
student_id = data['data']['StudentDto']['XH']
|
||||||
print(student_name)
|
|
||||||
return {'errcode': 200, 'errmsg': 'ok', 'ip': ip, 's': s,'student_name':student_name,'student_id':student_id}
|
return {'errcode': 200, 'errmsg': 'ok', 'ip': ip, 's': s,'student_name':student_name,'student_id':student_id}
|
||||||
|
|
||||||
def getGrade(Ip, S):
|
def getGrade(Ip, S):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user