Skip to content

Commit

Permalink
Merge pull request #83 from kshvmdn/fix/courses/enrolment-count
Browse files Browse the repository at this point in the history
Enrolment count
  • Loading branch information
qasim authored Sep 5, 2016
2 parents cd668fd + f3392d4 commit c5a0a3a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion uoftscrapers/scrapers/courses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c5a0a3a

Please sign in to comment.