Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
popravi error
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Oct 5, 2023
1 parent 60b726d commit 0705186
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gimsisapi/formtagparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ def get_absences(text, type: int):
soup = BeautifulSoup(text, "html.parser")
absences = []
if type == AbsenceType.by_subjects:
for i in soup.find("table", id="ctl00_ContentPlaceHolder1_gvwPregledIzostankovPredmeti").find("tbody").find_all("tr"):
n = soup.find("table", id="ctl00_ContentPlaceHolder1_gvwPregledIzostankovPredmeti")
if n is None:
return absences
for i in n.find("tbody").find_all("tr"):
f = i.find_all("td")
absences.append(
SubjectAbsence(
Expand All @@ -193,7 +196,10 @@ def get_absences(text, type: int):
elif type == AbsenceType.by_days:
current_day = ""
days = {}
for i in soup.find("table", id="ctl00_ContentPlaceHolder1_gvwPregledIzostankov").find("tbody").find_all("tr"):
n = soup.find("table", id="ctl00_ContentPlaceHolder1_gvwPregledIzostankov")
if n is None:
return days
for i in n.find("tbody").find_all("tr"):
f = i.find_all("td")
if re.match(r"(.*)\.(.*)\.(.*)", f[0].text.strip()) is not None:
current_day = f[0].text.strip()
Expand Down

0 comments on commit 0705186

Please sign in to comment.