Skip to content

fix: scrape course units from the units key without crashing - #116

Open
AshSgDe29071999 wants to merge 1 commit into
compsci-adl:mainfrom
AshSgDe29071999:fix/114-units-key
Open

fix: scrape course units from the units key without crashing#116
AshSgDe29071999 wants to merge 1 commit into
compsci-adl:mainfrom
AshSgDe29071999:fix/114-units-key

Conversation

@AshSgDe29071999

Copy link
Copy Markdown

Summary

`scraper.py` looked up `unit_value` while `get_course_details` emits `units`, so every course became 6. `int("3 units")` also crashed.

Changes

  • Read `course_details["units"]`
  • `parse_units()` takes the first digit run, defaults to 6 if missing/non-numeric
  • BUSI6040-style 12-unit courses can now persist 12

Test plan

  • `parse_units(None) == 6`, `parse_units("12") == 12`, `parse_units("3 units") == 3`

Fixes #114

get_course_details returns "units", not "unit_value", so every course
was stored as the default 6. int() also crashed on values like
"3 units". Parse the first integer and default to 6 only when missing.

Fixes compsci-adl#114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Incorrect course unit parsing during scraping

1 participant