Skip to content

Commit 85738e5

Browse files
committed
Fix parsing javascript to get exam id
1 parent a9c2494 commit 85738e5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

CampusNet.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,8 @@ def _get_modules(self):
148148
except ValueError:
149149
grade = None
150150
# getting id for this module
151-
exams_button = cells[5]
152-
# FIXME: This is a hack, looking for a specific substring in JavaScript code.
153-
exams_script = exams_button.find('script').text
154-
exams_id = exams_script.split('","Resultdetails"')[0].split(",-N")[-1]
151+
exams_button = cells[5].find("a")
152+
exams_id = exams_button.get("href").split(",-N")[-2]
155153
modules.append(Module(
156154
num=cells[0].text.strip(),
157155
name=cells[1].text.strip(),

0 commit comments

Comments
 (0)