Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
simple python script for getting report card form birjand university of technology portal
# its just for command line geeks!
# Enter your username and password and run :)
# I got tired to loging and refreshing my university portal!
#try to make my and my friends life much easer with this simple script
#if you are developer u can use my functions to develope application or bot for university portal, MAKE ME HAPPY with that :)
import requests,hashlib,pickle
from bs4 import BeautifulSoup
def get_session(username, password):
md5 = hashlib.md5()
user =str(username)
head={'UserID': user ,'UserPassword':md5.hexdigest() , 'pswdStatus': 'strong', 'DummyVar': ''}
url = ''
page =, data=head)
s = requests.Session()
response =, data=head)
return requests.utils.dict_from_cookiejar(s.cookies)
def grade_show(session):
num = requests.get('',cookies=session)
page = num.text
soup = BeautifulSoup(page,'html')
row = soup.find_all('tr')
for r in row:
soup = BeautifulSoup(str(r),'lxml')
table = soup.find_all('td')
for x in table:
return report
# Exp:
# user = 9213312345
# pass = 123456 :-D
## update : cleaning output !
for row in grade_show(get_session('user','pass')):
print " | ".join([(x if x is not None else '') for x in row])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.