Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- import string
- sv=ba=en=eg=ar=ti=0
- for i in open("codigos.txt","r").readlines():
- s="http://www.orce.uni.edu.pe/detaalu.php?id="+i[:-1]+"&op=detalu"
- r=urllib2.urlopen(s)
- h=r.read()
- no=string.rstrip(" ".join(h.split('Nombres')[1][0:104].split("<td>")[1].split("</td>")[0].split("-"))).title()
- si=h.split('Situaci')[1][0:54].split("<td>")[1].split("</td>")[0]
- print "+ "+i[:-1] +" "+no+" -> " +si
- if si=='SUSPENSION VOLUNTARIA':
- sv=sv+1
- elif si=='BACHILLER':
- ba=ba+1
- elif si=='EN REGULARIZACION DE CURSO(':
- en=en+1
- elif si=='EGRESADO':
- eg=eg+1
- elif si=='TITULADO':
- ti=ti+1
- else:
- ar=ar+1
- print "+ TITULADOS : "+ str(ti)+ "\n+ BACHILLER : "+ str(ba)+ "\n+ EGRESADO : "+ str(eg) +"\n+ SUSPENSION VOLUNTARIA : "+ str(sv)+"\n+ EN REGULARIZACION DE CURSO : "+ str(en)+" \n+ ALUMNOS REGULARES : "+ str(ar)
Advertisement
Add Comment
Please, Sign In to add comment