Created
November 7, 2017 12:20
-
-
Save abuvanth/4e9ba839958726dada16c0b88db75ce6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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