diff --git a/uoftscrapers/scrapers/courses/__init__.py b/uoftscrapers/scrapers/courses/__init__.py index 617faae..d922c34 100755 --- a/uoftscrapers/scrapers/courses/__init__.py +++ b/uoftscrapers/scrapers/courses/__init__.py @@ -183,6 +183,11 @@ def parse_course_html(course_id, html): class_size = tds[4].get_text().strip() + try: + current_enrolment = tds[5].get_text().strip() + except (IndexError, AttributeError) as e: + current_enrolment = 0 + time_data = [] for i in range(len(times)): info = times[i].split(" ") @@ -215,7 +220,7 @@ def parse_course_html(course_id, html): ("instructors", instructors), ("times", time_data), ("size", int(class_size)), - ("enrolment", 0) + ("enrolment", int(current_enrolment)) ]) sections.append(data)