-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (33 loc) · 1.18 KB
/
main.py
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
# Siddharth Lohani
# 2/25/2021
# selenium imports
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
# scheduling tasks
import schedule
import time
# import other scripts in directory
import settings
import functions
userAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.50 Safari/537.36'
# setting up chrome driver
chromeOptions = Options()
chromeOptions.add_argument('--no-sandbox')
chromeOptions.add_argument('--disable-dev-shm-usage')
chromeOptions.add_argument("--window-size=1920,1080")
chromeOptions.add_argument('--ignore-certificate-errors')
chromeOptions.add_argument('--allow-running-insecure-content')
chromeOptions.add_argument(f'user-agent={userAgent}')
driver = webdriver.Chrome('./chromedriver', options=chromeOptions)
previousGrades = {}
functions.login(driver)
functions.getInitialGrades(driver, settings.classes, previousGrades)
functions.logout(driver)
def run():
functions.login(driver)
functions.checkAndUpdateGrades(driver, previousGrades)
functions.logout(driver)
while True:
run()
time.sleep(settings.REFRESH_INTERVAL * 60)