GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python/jee_result.py at master · CHAOYUHONG/Python Expand file tree/ Copy pathjee_result.pyMore file actions 49 lines (41 loc) · 1.11 KB / Copy pathjee_result.pyFile metadata and controls49 lines (41 loc) · 1.11 KB 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 49 from bs4 import BeautifulSoup import datetime import mechanize import urllib2 # Create a Browser b = mechanize.Browser() # Disable loading robots.txt b.set_handle_robots(False) b.addheaders = [('User-agent', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;)')] # Navigate b.open('http://cbseresults.nic.in/jee/jee_2015.htm') # Choose a form b.select_form(nr=0) # Fill it out b['regno'] = '37000304' currentdate = datetime.date(1997,3,10) enddate = datetime.date(1998,4,1) while currentdate <= enddate: ct=0 #print currentdate yyyymmdd = currentdate.strftime("%Y/%m/%d") ddmmyyyy = yyyymmdd[8:] + "/" + yyyymmdd[5:7] + "/" +yyyymmdd[:4] print(ddmmyyyy) b.open('http://cbseresults.nic.in/jee/jee_2015.htm') b.select_form(nr=0) b['regno'] = '37000304' b['dob'] = ddmmyyyy fd = b.submit() #print(fd.read()) soup = BeautifulSoup(fd.read(),'html.parser') for writ in soup.find_all('table'): ct = ct + 1; #print (ct) if ct == 6: print("---fail---") else: print("--true--") break; currentdate += datetime.timedelta(days=1) #print fd.read() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |