学生请假信息查询工具 - 使用 Python 和 Tkinter
import tkinter as tk
import requests
cookies = {
'_webvpn_key': 'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiMjAwNTAyMTQwMjI0IiwiZ3JvdXBzIjpbMTIxLDFdLCJpYXQiOjE2ODA4Nzk5ODMsImV4cCI6MTY4MDk2NjM4M30.NbCh7GQDfdGMmEKg-2CRw6vGuuhGvuyClzsXWkL4TMY',
'webvpn_username': '200502140224|1680879983|92b70d0a01a6b70b67df9fb695a05fe64f574000',
'JSESSIONID': '88E5F0A4D2E6C19117A295797417F737',
}
headers = {
'authority': 'jwgl.webvpn.nepu.edu.cn',
'accept': 'application/json, text/javascript, */*; q=0.01',
'accept-language': 'zh-CN,zh;q=0.9',
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
'dnt': '1',
'origin': 'https://jwgl.webvpn.nepu.edu.cn',
'referer': 'https://jwgl.webvpn.nepu.edu.cn/new/student/xsqjsq',
'sec-ch-ua': "'Google Chrome';v='111', 'Not(A:Brand';v='8', 'Chromium';v='111'",
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': "'macOS'",
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
'x-requested-with': 'XMLHttpRequest',
}
def sendtoserver(_webvpn_key, JSESSIONID1, webvpn_username):
cookies['_webvpn_key'] = _webvpn_key
cookies['JSESSIONID'] = JSESSIONID1
cookies['webvpn_username'] = webvpn_username
data = {
'page': '1',
'rows': '20',
'sort': 'k501.cjsj',
'order': 'desc',
}
response = requests.post('https://jwgl.webvpn.nepu.edu.cn/new/student/xsqjsq/datas', cookies=cookies, headers=headers, data=data)
print(response.text)
res_json = response.json()
bingding = []
for i in res_json['rows']:
print(i['qsrq'], i['qssj'], i['jsrq'], i['jssj'], i['bz'])
bingding.append(i['qsrq'] + ' ' + i['qssj'] + ' ' + i['jsrq'] + ' ' + i['jssj'] + ' ' + i['bz'] + 'sqdm:' + i['sqdm'])
return bingding
def on_submit():
_webvpn_key = entry1.get()
JSESSIONID1 = entry2.get()
webvpn_username = entry3.get()
sendtoserver(_webvpn_key, JSESSIONID1, webvpn_username)
root = tk.Tk()
root.title('学生请假信息查询')
root.geometry('500x300')
label1 = tk.Label(root, text='请输入_webvpn_key:')
label1.pack()
entry1 = tk.Entry(root)
entry1.pack()
label2 = tk.Label(root, text='请输入JSESSIONID:')
label2.pack()
entry2 = tk.Entry(root)
entry2.pack()
label3 = tk.Label(root, text='请输入webvpn_username:')
label3.pack()
entry3 = tk.Entry(root)
entry3.pack()
button = tk.Button(root, text='提交', command=on_submit)
button.pack()
root.mainloop()
原文地址: https://www.cveoy.top/t/topic/ndnI 著作权归作者所有。请勿转载和采集!