Files
python----/智慧校园/本部/生成本周课程表.ipynb
T
2025-10-20 12:32:18 +08:00

103 lines
2.5 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "318e7588",
"metadata": {},
"outputs": [],
"source": [
"from requests import get,post\n",
"import time\n",
"ip = \"http://band.hxzhxy.cn\"\n",
"# ip = \"http://192.168.0.244:8100\"\n",
"\n",
"param = {\n",
" \"username\": \"tangchao\",\n",
" \"password\": \"123456a\",\n",
" \"client_id\": \"client\",\n",
" \"grant_type\": \"password\",\n",
" \"client_secret\": \"123456\",\n",
"}\n",
"data = get(url=f\"http://band.hxzhxy.cn/oauth/token?username=zhongwei&password=123456a&client_id=client&grant_type=password&client_secret=123456\").json()\n",
"token = data[\"access_token\"]\n",
"header = {\n",
" \"content-type\": \"application/json\",\n",
" \"authorization\": f\"Bearer {token}\",\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "3c046d8d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<html>\n",
"<head><title>404 Not Found</title></head>\n",
"<body bgcolor=\"white\">\n",
"<center><h1>404 Not Found</h1></center>\n",
"<hr><center>nginx/1.4.0</center>\n",
"</body>\n",
"</html>\n",
"\n",
"<html>\n",
"<head><title>404 Not Found</title></head>\n",
"<body bgcolor=\"white\">\n",
"<center><h1>404 Not Found</h1></center>\n",
"<hr><center>nginx/1.4.0</center>\n",
"</body>\n",
"</html>\n",
"\n",
"<html>\n",
"<head><title>404 Not Found</title></head>\n",
"<body bgcolor=\"white\">\n",
"<center><h1>404 Not Found</h1></center>\n",
"<hr><center>nginx/1.4.0</center>\n",
"</body>\n",
"</html>\n",
"\n"
]
}
],
"source": [
"for i in range(24,27):\n",
" print(post(f\"{ip}/classAttendStu/createThisWeek\",headers=header,params={\"planId\":i},timeout=600).text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "343a9e44",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}