-
Notifications
You must be signed in to change notification settings - Fork 0
/
aures2.py
44 lines (33 loc) · 986 Bytes
/
aures2.py
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
42
43
44
from mechanize import Browser
from bs4 import BeautifulSoup
import xlwt
result=xlwt.Workbook(encoding="utf-8")
s1=result.add_sheet("Sheet 1")
row1=["S.No.","REG. NO.","NAME","CS6001","CS6601","CS6611","CS6612","CS6659","CS6660","GE6674","IT6502","IT6601"]
for i,s in enumerate(row1):
s1.write(0,i,s)
stud=[]
for i in range(0,58):
stud.append("81001310"+str(input()))
print "Done"
for i,reg in enumerate(stud):
browser=Browser()
browser.open("http://aucoe.annauniv.edu/result/134679852/cgrade.html")
browser.select_form(nr=0)
browser['regno']=reg
response=browser.submit()
content=response.read()
soup=BeautifulSoup(content)
table=soup.find('table')
header=[]
for strong in table.find_all('strong'):
header.append(str(strong.text).replace('\n','').replace('\r',''))
s1.write(i+1,0,str(i+1))
s1.write(i+1,1,header[0])
s1.write(i+1,2,header[1])
j=3;
for s in row1[3:]:
pos=header.index(s);
s1.write(i+1,j,header[pos+1])
j+=1
result.save("result2.xls")