-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvturesult.py
More file actions
41 lines (30 loc) · 716 Bytes
/
vturesult.py
File metadata and controls
41 lines (30 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import mechanize
start = 1
end = 130
list_usn = [format(a, "03d") for a in range(start,end)]
fcd, fc, fail, sc, na = 0, 0, 0, 0, 0
for i in list_usn:
br = mechanize.Browser()
br.open("http://results.vtu.ac.in")
br.select_form(name = "new")
base_usn = "1ds12is"
usn = base_usn + str(i)
br["rid"] = usn
response = br.submit()
a = response.get_data()
if "FIRST CLASS WITH DISTINCTION" in a:
fcd = fcd + 1
elif "FIRST CLASS" in a:
fc = fc + 1
elif "SECOND CLASS" in a:
sc = sc + 1
elif "FAIL" in a:
fail = fail + 1
else:
na = na + 1
print "\n\nResults:"
print "First Class Distinction =",fcd
print "First Class =",fc
print "Second Class=",sc
print "Fail =",fail
print "N.A =",na,"\n"