Skip to content

Instantly share code, notes, and snippets.

@abuvanth
Created November 7, 2017 12:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abuvanth/4e9ba839958726dada16c0b88db75ce6 to your computer and use it in GitHub Desktop.
Save abuvanth/4e9ba839958726dada16c0b88db75ce6 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup as bs
import csv
u=int(raw_input("Enter Your starting Reg No "))
n=int(raw_input("Enter Your Ending Reg No "))
while u<=n: #ending Register number
r=requests.post('http://aucoe.annauniv.edu/cgi-bin/result/cgrade.pl',data={'regno':u})
u=u+1
s=bs(r.content,'html.parser')
a=[]
f=open('audata.csv','a+')
writer=csv.writer(f)
a=[]
for st in s.find_all('strong'):
a.append(st.text)
if len(a)!=6:
while a:
writer.writerow(a[:3])
a=a[3:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment