Created
April 27, 2015 02:09
-
-
Save benesch/43515655b1f877779522 to your computer and use it in GitHub Desktop.
Q guide scraper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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