Michael Wang пре 3 година
родитељ
комит
5a4a2ef366
1 измењених фајлова са 7 додато и 1 уклоњено
  1. 7 1
      src/devLogin.ts

+ 7 - 1
src/devLogin.ts

@@ -15,7 +15,13 @@ export async function initLogin() {
   f.append("password", password);
 
   return fetch("/login", { body: f, method: "POST" })
-    .then(async (r) => console.log(r))
+    .then(async (r) => {
+      const body = await r.text();
+      const exams = body.match(
+        /<select name="examId" id="exam-select">.*<\/select>/gims
+      );
+      console.log(exams && exams[0].replace(/\n/g, ""));
+    })
     .then(() => {
       const f = new FormData();
       f.append("examId", examId);