Created
August 5, 2014 23:22
-
-
Save cshjin/6ed3ab9a787d6ec98a3f to your computer and use it in GitHub Desktop.
This is the processing file to get online courses of IIT(Illinois Institution of Technology),
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Aug 28 10:28:18 2013 | |
@author: King | |
""" | |
import httplib | |
import urllib2 | |
subs = ['BIOL', 'CAE', 'CHE', 'CHEM', 'COM', 'CS', 'CSP', 'ECE', 'ECON', 'ENVE', | |
'FPE', 'FST', 'INTM', 'IPRO', 'ITMD', 'ITMM', 'ITMO', 'ITMS', | |
'ITMT', 'MATH', 'MMAE', 'PHYS', 'PSYC', 'TECH'] | |
for sub in subs: | |
for i in range(100, 700): | |
conn = httplib.HTTPConnection('media.iitonline.iit.edu') | |
if len(sub) == 2: | |
url = '/lectures/'+sub+'-'+str(i)+'-01-/index.html' | |
elif len(sub) == 3: | |
url = '/lectures/'+sub+'-'+str(i)+'-01/index.html' | |
elif len(sub) == 4: | |
url = '/lectures/'+sub+'-'+str(i)+'-0/index.html' | |
#conn.request('HEAD', '/lectures/CS-480-01-/index.html') | |
conn.request('HEAD', url) | |
if conn.getresponse().status == 200: | |
cont = urllib2.urlopen('http://media.iitonline.iit.edu' + url).read() | |
print cont[cont.find('h4')+3:cont.find('/h4')-1].split('</br>')[2] | |
print '\t http://media.iitonline.iit.edu' + url | |
print ' ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not available from 2015 Spring.
🙅