-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_class_pdf.py
32 lines (26 loc) · 928 Bytes
/
test_class_pdf.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
from esprit import Esprit
# Create an Esprit object
esprit = Esprit()
# Replace with your actual ID and password
id = 'ID'
password = 'PASSWORD'
class_name = 'CLASS_NAME'
download_path = "C:/path/to/download/folder/"
# Attempt to log in
esprit.login(id, password)
# Get the last week's schedule
schedule = esprit.get_last_week_schedule()
if schedule is not None:
# Download the last week's schedule
file_path = esprit.download_files(schedule, download_path)
print("Downloaded the last week's schedule.")
# Get the schedule for class 2A23
class_schedule_path = esprit.get_class_week_schedule(
file_path, class_name, download_path)
if class_schedule_path is not None:
print(
f"Downloaded the schedule for class 2A23 at {class_schedule_path}")
else:
print("Failed to get the schedule for class 2A23.")
else:
print("Failed to get the last week's schedule.")