import requests as r import time import winsound USER = YOUR_USERNAME_HERE PASS = YOUR_PASSWORD_HERE s = r.Session() last_th = -1 while True: res = s.post('https://grades.cs.technion.ac.il', {'ID': USER, 'Password':PASS, 'submit': 'proceed', 'Page': 'grades.html', 'Login': 1}) if '=xxx' in res.headers.get('Set-Cookie', ''): raise Exception('Failed to login') res = s.post('https://grades.cs.technion.ac.il', {'COOKIE': res.cookies['LastGradesCookie'], 'RecreatePath': 1, 'SEM': '201902'}) res_str = res.text.lower() if 'finala' not in res_str: raise Exception('Not in grades page') if last_th == -1: last_th = res_str.count("