-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
30 lines (25 loc) · 953 Bytes
/
example.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
"""Usage example"""
# To test Library installed from PyPi, use this import:
from ontu_parser.classes import Parser
# To test Library from source code, use this import:
# from classes import Parser
# An example of how to pass arguments to Firefox browser created by selenium
# Add arguments inside 'browser_settings' and see what happens
parser = Parser()
schedule = parser.parse(all_time=False)
for day_name, pairs in schedule.items():
print(f"{day_name}:\n")
for pair in pairs:
if not pair.lessons:
continue
print(f"{pair.pair_no}:")
for lesson in pair.lessons:
print(
f'{lesson.lesson_date}: '
f'{lesson.teacher["short"]} - '
f'{lesson.lesson_name["short"]}'
f' - In auditorium: {lesson.auditorium}'
if lesson.auditorium
else ""
)
print(f"Card: {lesson.lesson_info}\n")