Parsers¶
Parser functions accept raw EAMS HTML strings and return plain Python dicts. They contain no network I/O and can be used standalone (e.g. in tests with captured fixtures).
tju.parser.parse_schedule
¶
parse course table
Source code in src/tju/parser/schedule.py
tju.parser.parse_profile
¶
parse personal profile
Source code in src/tju/parser/profile.py
tju.parser.parse_course
¶
Source code in src/tju/parser/course.py
tju.parser.parse_course_info
¶
tju.parser.parse_syllabus
¶
tju.parser.parse_exam
¶
parse exam
Source code in src/tju/parser/exam.py
tju.parser.parse_exam_batch_id
¶
tju.parser.parse_score
¶
parse score
Source code in src/tju/parser/score.py
tju.parser.parse_score_exp
¶
Source code in src/tju/parser/score.py
tju.parser.parse_free_classroom
¶
Parse the EAMS free-classroom search result HTML into a list of dicts.
The result page is an EAMS gridtable fragment (no full wrapper) loaded into the freeRoomList div by the browser. It uses the same
Raises:
| Type | Description |
|---|---|
DataError
|
when the EAMS server returns a known error message (e.g. "借用教室小节错误", rate-limit, permission denied). |
HtmlParseError
|
when the response looks like an unexpected HTML structure. |