fix: schedule_week showing data
This commit is contained in:
@@ -46,7 +46,7 @@ def get_schedule_week(url: str):
|
|||||||
schedule_week = []
|
schedule_week = []
|
||||||
|
|
||||||
for i in range(len(rows)):
|
for i in range(len(rows)):
|
||||||
if rows[i].find("td", class_="KuvSuplovanaHodina") is not None and rows[i].find("td", class_="KuvSuplujiciHodina") is None and rows[i].find("td", class_="KuvSkolniAkceHodina") is None:
|
if rows[i].find("td", class_="KuvSuplovanaHodina") is not None and rows[i].find("td", class_="KuvSuplujiciHodina") is None and rows[i].find("td", class_="KuvSkolniAkceHodina") is None and rows[i].find("td", class_="DctInnerTableType10DataTD") is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
subjects = []
|
subjects = []
|
||||||
@@ -74,6 +74,8 @@ def get_schedule_week(url: str):
|
|||||||
for j in range(len(subjects_)):
|
for j in range(len(subjects_)):
|
||||||
if "KuvSuplovanaHodina" not in subjects_[j].parent["class"]:
|
if "KuvSuplovanaHodina" not in subjects_[j].parent["class"]:
|
||||||
temp.append(subjects_[j].text)
|
temp.append(subjects_[j].text)
|
||||||
|
else:
|
||||||
|
temp.append("Volno")
|
||||||
subjects = temp
|
subjects = temp
|
||||||
|
|
||||||
F_continue = False
|
F_continue = False
|
||||||
@@ -106,12 +108,23 @@ def get_schedule_week(url: str):
|
|||||||
for j in range(len(cells)):
|
for j in range(len(cells)):
|
||||||
if cells[j].get("colspan") is not None:
|
if cells[j].get("colspan") is not None:
|
||||||
if int(cells[j].get("colspan")) == 2:
|
if int(cells[j].get("colspan")) == 2:
|
||||||
subjects.insert(j, subjects[j-1])
|
try:
|
||||||
wheres.insert(j, wheres[j-1])
|
subjects.insert(j, subjects[j])
|
||||||
|
wheres.insert(j, wheres[j])
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
for j in range(len(subjects)):
|
for j in range(len(subjects)):
|
||||||
if subjects[j] == "Volno":
|
if subjects[j] == "Volno":
|
||||||
wheres.insert(j, " - ")
|
wheres.insert(j, " - ")
|
||||||
|
|
||||||
|
while True:
|
||||||
|
if len(subjects) > len(wheres):
|
||||||
|
del subjects[-1]
|
||||||
|
elif len(subjects) < len(wheres):
|
||||||
|
del wheres[-1]
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
if F_continue == False:
|
if F_continue == False:
|
||||||
schedule_week_row = {
|
schedule_week_row = {
|
||||||
"DAY": day,
|
"DAY": day,
|
||||||
|
|||||||
Reference in New Issue
Block a user