-
Notifications
You must be signed in to change notification settings - Fork 0
/
college_range.py
48 lines (36 loc) · 925 Bytes
/
college_range.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
45
46
47
48
##!/usr/bin/env python
'''
NON FUNCTIONING
Still under works
Code to find each college's range of roll numbers
1st year results have approximately 30 seats reserved which are left blank at the end
Feroze Naina
'''
from decimal import *
import urllib3
from BeautifulSoup import BeautifulSoup
import sqlite3
import base64
import os
num=1027100
flag=0
while(not flag):
regno= str(num)
URL="http://www1.annatech.ac.in/result/index.php?regno="+ base64.encodestring(str(regno))
http_pool = urllib3.connection_from_url(URL)
page=http_pool.post_url(URL)
#print page.data
#Beautiful Soup Start
soup=BeautifulSoup(page.data)
#Extract roll, name, branch
bio = soup.findAll('strong')
try:
x=bio[2].renderContents()
except IndexError:
print "GOtcha"
flag=1
print num
num=num+50
if (flag):
print "No is"
print num