Skip to content

Instantly share code, notes, and snippets.

@zachbellay
Last active November 13, 2017 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachbellay/46bf13c354f2e6acae873637be70e868 to your computer and use it in GitHub Desktop.
Save zachbellay/46bf13c354f2e6acae873637be70e868 to your computer and use it in GitHub Desktop.
Download SCU Course Evals
import urllib2
with open('valid_ids.txt') as f:
mylist = f.read().splitlines()
for i in mylist:
url = 'https://evaluations.scu.edu/?vclass=' + str(i) + '&vtrm=3820'
opener = urllib2.build_opener()
opener.addheaders.append(('Cookie', 'SimpleSAMLAuthToken=EXAMPLE; PHPSESSID=EXAMPLE'))
response = opener.open(url)
filename = str(i) + '.pdf'
print filename
file = open(filename, "wb")
file.write(response.read())
file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment