Skip to content

Commit

Permalink
Fixed crash when listing courses
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvbl committed Jul 10, 2017
1 parent 23541cf commit 155c1ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,11 @@ def processDiscussionForum(institution, pathThusFar, discussionURL, session):
def processAssignment(institution, pathThusFar, assignmentURL, session):
print("\tDownloading assignment:", assignmentURL.encode('ascii', 'ignore'))
assignment_response = session.get(assignmentURL, allow_redirects=True)

if itslearning_unauthorized_url[institution] in assignment_response.url:
print('\t Access denied. Skipping.')
return

assignment_document = fromstring(assignment_response.text)
#writeHTML(assignment_document, 'output.html')

Expand Down Expand Up @@ -1966,6 +1971,7 @@ def list_courses_or_projects(institution, session, list_page_url, form_string, u
# The latter is a necessity due to the possibility of project invitations
if len(entry) > 0 and len(entry[0]) > 0 and len(entry[0][0]) > 4:
courseTableDivElement = entry
break
except Exception:
pass
if courseTableDivElement is None:
Expand Down

0 comments on commit 155c1ec

Please sign in to comment.