Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def parse_students(course, year, no, exam):
- ret = []
- appellore = re.compile(_appelloptn)
- studentre = re.compile(_studentptn)
- url = "http://compass2.di.unipi.it/didattica/%s/share/orario/Appelli/" % course \
- + "appelliret.asp?letter=&ycourse=&course=%s&year=%d&start=%d&end=%d&chk=%s" % \
- (course, year, no, no, exam)
- h = utils.web.url2html(url)
- matches = appellore.finditer(h)
- try:
- m = matches.next()
- except StopIteration:
- return []
- url = "http://compass2.di.unipi.it/didattica/inf31/share/orario/Appelli/lista.asp?action=list&appello=%s" \
- % m.group(1)
- h = utils.web.url2html(url)
- matches = studentre.finditer(h)
- ok = True
- while ok:
- try:
- m = matches.next()
- ret.append([m.group(1), m.group(2), m.group(3), m.group(4)])
- #print m.group(1), m.group(2), m.group(3), "Note:", m.group(4)
- except StopIteration:
- ok = False
- return ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement