def class_info(subj, clno, curr_term=1166): course_info = "http://student.apps.utah.edu/uofu/stu/ClassSchedules/main/{0}/sections.html?subj={1}&catno={2}".format( curr_term, subj.upper(), clno ) info = createsoup(course_info).find_all("tr") return list( dict(zip([x.string for x in info[0].findChildren(["th"])], [x.string for x in info[i].findChildren(["td"])])) for i in range(1, len(info)) )
def class_info(subj, clno, curr_term=1166): course_info = 'http://student.apps.utah.edu/uofu/stu/ClassSchedules/main/{0}/sections.html?subj={1}&catno={2}'.format( curr_term, subj.upper(), clno) info = createsoup(course_info).find_all('tr') return list( dict( zip([x.string for x in info[0].findChildren(['th'])], [x.string for x in info[i].findChildren(['td'])])) for i in range(1, len(info)))
def courses_info(dept, curr_term = 1158): dept_page = 'http://www.acs.utah.edu/uofu/stu/scheduling?term={0}&dept={1}&classtype=g&cmd='.format(curr_term, dept, '') course_table = createsoup(dept_page).find_all('table')[courses_idx].find_all('tr')[2:] return [[x.get_text().replace('\xa0', '').strip(' \n') for x in course.find_all('td')] for course in course_table]