Skip to content

Commit d5c8712

Browse files
committed
Add support for parsing degrees in restrictions
Yet another possibility in SIS data we did not catch earlier.
1 parent 668755b commit d5c8712

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/scrapers/sis_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"Majors": "major",
1313
"Classes": "classification",
1414
"Levels": "level",
15+
"Degrees": "degree",
1516
}
1617

1718

@@ -295,13 +296,13 @@ async def get_class_restrictions(session: aiohttp.ClientSession, term: str, crn:
295296
"not_level": [],
296297
"classification": [],
297298
"not_classification": [],
299+
"degree": [],
300+
"not_degree": [],
298301
}
299302
restrictions_tag = soup.find("section", {"aria-labelledby": "restrictions"})
300303
# Other known restriction header patterns include:
301304
# "Special Approvals:"
302-
restriction_header_pattern = (
303-
r"(Must|Cannot) be enrolled in one of the following (Majors|Classes|Levels):"
304-
)
305+
restriction_header_pattern = r"(Must|Cannot) be enrolled in one of the following (Majors|Classes|Levels|Degrees):"
305306
# All known children of the restrictions section are <div>, <span<>, or <br> tags
306307
# Tags relevant to restrictions are only known to be <span> tags
307308
restrictions_content = [

0 commit comments

Comments
 (0)