aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--management/commands/scraptimetables.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/management/commands/scraptimetables.py b/management/commands/scraptimetables.py
index da8899c..780ea8d 100644
--- a/management/commands/scraptimetables.py
+++ b/management/commands/scraptimetables.py
@@ -32,7 +32,9 @@ class Command(BaseCommand):
soup = get_xml(finder)
for link in soup.find_all("a"):
if "toutes sections et semestres confondus" in link.text:
- print(year, name, link.text, link.parent.parent.find("a", attrs={"class": "xmllink"})["href"])
+ url_base = finder.rsplit("/", 1)
+ timetable_url = "/".join([url_base[0], link.parent.parent.find("a", attrs={"class": "xmllink"})["href"]])
+ print(year, name, link.text, timetable_url)
def __get_finders(self, url):
soup = get_xml(url)