forked from jonnieeg13/Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
30 lines (28 loc) · 914 Bytes
/
run.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
from syllabusbot.courses import Courses
import syllabusbot.unconstants as uncons
import syllabusbot.constants as cons
try:
with Courses(teardown=True) as bot:
bot.land_first_page()
bot.click_student_btn()
bot.login()
bot.select_username(uncons.USER)
bot.select_username_next()
bot.select_password(uncons.PASS)
bot.select_password_sign_in()
bot.botwait()
bot.manage_classes_select()
bot.refresh()
bot.extract_classes()
print('Exiting ...')
except Exception as e:
if 'in PATH' in str(e):
print(
'You are trying to run the bot from command line \n'
'Please add to PATH your Selenium Drivers \n'
'Windows: \n'
f' set PATH=%PATH%;{cons.DRIVER_PATH} \n \n'
'Linux: \n'
f' PATH=$PATH:{cons.DRIVER_PATH}')
else:
raise