diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-09-14 17:33:18 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-09-14 17:33:18 +0200 |
| commit | d18d5f869d57d31c987b4b7fe0c7feae9aba8b2e (patch) | |
| tree | c6d6a3cbae12a1f122d000084d8ffd8bbf481470 /src/student-prod.ts | |
| parent | 6fd920d11d53b27b04d74495ec14b847f7c36d43 (diff) | |
| download | bycs-sol-d18d5f869d57d31c987b4b7fe0c7feae9aba8b2e.tar.gz bycs-sol-d18d5f869d57d31c987b4b7fe0c7feae9aba8b2e.zip | |
fetchStudents: do not consider innerHTML for role selection
The HTML for the role assignments contains all options and thus
makes the separation not possible.
Diffstat (limited to 'src/student-prod.ts')
| -rw-r--r-- | src/student-prod.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/student-prod.ts b/src/student-prod.ts index 0dcbc71..5a1673e 100644 --- a/src/student-prod.ts +++ b/src/student-prod.ts @@ -26,12 +26,13 @@ async function _fetchStudents() { const doc = new DOMParser().parseFromString(await res.text(), "text/html"); const table = doc.querySelector("tbody")!; const fetchedStudents: Array<Student> = []; - table.querySelectorAll("tr").forEach((row) => { + const rows = table.querySelectorAll("tr"); + rows.forEach((row) => { if (row.classList.contains("emptyrow")) return; const roleCell = row.querySelector(".c4")!; // TODO(muhq): Is this locale dependent? - if (roleCell.innerHTML.includes("Lehrer")) { + if (roleCell.textContent.includes("Lehrer")) { return; } |
