Skip to content

Commit

Permalink
Fixed unable to download hotspot images from online tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvbl committed Jul 3, 2017
1 parent 85220d9 commit 2fb1e9d
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 @@ -1119,6 +1119,12 @@ def processOnlineTestAttempt(institution, session, details_URL, dumpDirectory, a
if image_URL is None:
continue

# The image links produced by It's Learning for hotspot images have a bunch of spaces in front, plus a special character.
# removing both of those here to obtain the relative link. Direct URL's are unaffected by this because they should not
# contain spaces in the first place.
image_URL = image_URL.split(' ')[-1]


# Special case for relative URL's: drop the It's Learning root URL in front of it
if not image_URL.startswith('http'):
image_URL = itslearning_root_url[institution] + image_URL
Expand Down

0 comments on commit 2fb1e9d

Please sign in to comment.