Skip to content

Commit

Permalink
Workaround for crash while listing courses and projects
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvbl committed Jul 10, 2017
1 parent 804e71b commit e7500a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,11 @@ def list_courses_or_projects(institution, session, list_page_url, form_string, u
for index, courseTableRowElement in enumerate(courseTableElement.getchildren()):
if index == 0:
continue
if url_column_index][0].get('href') is None:
print("WARNING: Skipping course/project listing, as no URL was detected.")
print('List element:')
print(etree.tostring(courseTableRowElement))
continue
# Extract the course ID from the URL
courseURL = courseTableRowElement[url_column_index][0].get('href').split("=")[1]
courseList.append(courseURL)
Expand Down

0 comments on commit e7500a4

Please sign in to comment.