模块参数
字段 |
默认值 |
类型 |
描述 |
url |
|
String |
教务系统地址(必填 ) |
name |
NULL |
String |
学校名称 |
code |
NULL |
String |
学校英文缩写 |
login_url_path |
/default2.aspx |
String |
登录地址路径 |
lan_url |
None |
String |
内网地址 |
exist_verify |
True |
Bool |
是否存在验证码 |
use_ex_handle |
True |
Bool |
是否使用异常处理 |
priority_proxy |
False |
Bool |
是否优先使用代理 |
proxies |
None |
Json |
代理地址 |
url_path_list |
略 |
Json |
学校接口地址列表 |
class_time_list |
略 |
Json |
上课时间列表 |
timeout |
10 |
Int |
全局请求延时 |
session |
MemoryStorage |
Object |
缓存工具(推荐使用redis) |
url_path_list
字段 学校接口地址列表
[
{
"HOME_URL": "/xs_main.aspx?xh=",
"SCORE_URL": ["/xscj_gc.aspx?xh=", "/Xscjcx.aspx?xh=", "/xscjcx.aspx?xh="],
"INFO_URL": "/xsgrxx.aspx?gnmkdm=N121501&xh=",
"SCHEDULE_URL": [
"/xskbcx.aspx?gnmkdm=N121603&xh=",
"/tjkbcx.aspx?gnmkdm=N121601&xh=",
],
},
{
"HOME_URL": "/js_main.aspx?xh=",
"INFO_URL": "/lw_jsxx.aspx?gnmkdm=N122502&zgh=",
"SCHEDULE_URL": ["", "/jstjkbcx.aspx?gnmkdm=N122303&zgh="],
},
{
"HOME_URL": "/bm_main.aspx?xh=",
"SCHEDULE_URL": ["", "/tjkbcx.aspx?gnmkdm=N120313&xh="],
"PLACE_SCHEDULE_URL": "/kbcx_jxcd.aspx?gnmkdm=N120314&xh=",
},
]
class_time_list
字段 上课时间列表
[
["8:30", "9:15"],
["9:20", "10:05"],
["10:25", "11:10"],
["11:15", "12:00"],
["14:40", "15:25"],
["15:30", "16:15"],
["16:30", "17:15"],
["17:20", "18:05"],
["19:30", "20:15"],
["20:20", "21:05"]
]
from school_api import SchoolClient
conf = {
"url": 'http://210.38.137.126:8016',
'name': '广东科技学院',
'code': 'gdst',
'login_url_path': '/default2.aspx',
'exist_verify': True
}
school = SchoolClient(**conf)
from school_api import SchoolClient
conf = {
"url": 'http://210.38.137.126:8016',
"lan_url": "172.16.1.1",
"proxies": {"http": "http://xxxx:xxxx@xxxx.xxxx.xxxx:xxxx/"},
"priority_proxy": False
}
school = SchoolClient(**conf)
from redis import Redis
from school_api import SchoolClient
from school_api.session.redisstorage import RedisStorage
redis = Redis()
session = RedisStorage(redis)
conf = {
"url": 'http://210.38.137.126:8016',
"session": session
}
school = SchoolClient(**conf)