Skip to content

Commit 7fe190a

Browse files
author
mayank satnalika
authored
created jee_res file
Gives the result of student without date of birth
1 parent 8b18222 commit 7fe190a

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

jee_result.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import mechanize
2+
from bs4 import BeautifulSoup
3+
import urllib2
4+
# Create a Browser
5+
b = mechanize.Browser()
6+
7+
# Disable loading robots.txt
8+
b.set_handle_robots(False)
9+
10+
b.addheaders = [('User-agent',
11+
'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;)')]
12+
13+
# Navigate
14+
b.open('http://cbseresults.nic.in/jee/jee_2015.htm')
15+
16+
# Choose a form
17+
b.select_form(nr=0)
18+
19+
# Fill it out
20+
b['regno'] = '37000304'
21+
22+
import datetime
23+
currentdate = datetime.date(1997,3,10)
24+
enddate = datetime.date(1998,4,1)
25+
while currentdate <= enddate:
26+
ct=0
27+
#print currentdate
28+
yyyymmdd=currentdate.strftime("%Y/%m/%d")
29+
ddmmyyyy=yyyymmdd[8:]+"/"+yyyymmdd[5:7]+"/"+yyyymmdd[:4]
30+
print(ddmmyyyy)
31+
b.open('http://cbseresults.nic.in/jee/jee_2015.htm')
32+
b.select_form(nr=0)
33+
b['regno'] = '37000304'
34+
b['dob']=ddmmyyyy
35+
36+
fd = b.submit()
37+
#print(fd.read())
38+
soup = BeautifulSoup(fd.read(),'html.parser')
39+
40+
for writ in soup.find_all('table'):
41+
ct=ct+1;
42+
#print (ct)
43+
if ct==6:
44+
print("---fail---")
45+
else:
46+
print("--true--")
47+
break;
48+
currentdate += datetime.timedelta(days=1)
49+
#print fd.read()

0 commit comments

Comments
 (0)