Skip to content

Instantly share code, notes, and snippets.

@benesch
Created April 27, 2015 02:09
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 benesch/43515655b1f877779522 to your computer and use it in GitHub Desktop.
Save benesch/43515655b1f877779522 to your computer and use it in GitHub Desktop.
Q guide scraper
#!/usr/bin/env python
from __future__ import print_function
import requests
# This session ID can be obtained by signing into the Q from your
# browser and inspecting the value of the JSESSIONID cookie. It expires
# frequently!
SESSION_ID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
# Q URLs
Q_ROOT = 'https://webapps.fas.harvard.edu/course_evaluation_reports/fas/list'
session = requests.Session()
session.cookies = requests.utils.cookiejar_from_dict({
'JSESSIONID': SESSION_ID
})
session.verify = False
request = session.get(Q_ROOT)
print(request.text)
# do stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment