You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pronotepy
from pronotepy.ent import occitanie_toulouse_edu
client = pronotepy.ParentClient('https://0312744p.index-education.net/pronote/parent.html',
username='XXXXXXXX',
password='XXXXXXXX',
ent=occitanie_toulouse_edu)
if client.logged_in: # check if client successfully logged in
# get the all the periods (may return multiple types like trimesters and semesters but it doesn't really matter
# the api will get it anyway)
periods = client.periods
for period in periods:
for punishment in period.punishments:
print(punishment)
And I got this exception :
Traceback (most recent call last):
File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/dataClasses.py", line 220, in __call__
json_value = json_value[p]
~~~~~~~~~~^^^
KeyError: 'travailAFaire'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/services/pronote2rest/dev/test.py", line 17, in <module>
for punishment in period.punishments:
^^^^^^^^^^^^^^^^^^
File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/dataClasses.py", line 641, in punishments
return [Punishment(self._client, a) for a in absences if a["G"] == 41]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/dataClasses.py", line 641, in <listcomp>
return [Punishment(self._client, a) for a in absences if a["G"] == 41]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/dataClasses.py", line 2074, in __init__
self.homework: str = self._resolver(str, "travailAFaire")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/dataClasses.py", line 234, in __call__
raise ParsingError(
pronotepy.exceptions.ParsingError: Could not follow path
Here is how the punishment looks like in pronote :
It seems that there is no 'TravailAFaire'
The text was updated successfully, but these errors were encountered:
I try to get the punishments with this code :
And I got this exception :
Here is how the punishment looks like in pronote :
It seems that there is no 'TravailAFaire'
The text was updated successfully, but these errors were encountered: