Created
March 29, 2023 07:30
-
-
Save djshaji/385e7b0c7f24d6f9cf2b228cf43b3b5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list = {} | |
for (table of document.getElementsByTagName ("table")) { | |
name = null | |
reg = null | |
rollno = null | |
subjects = null | |
for (tr of table.getElementsByTagName ("tr")) { | |
for (td of tr.getElementsByTagName ("td")) { | |
if (td.width == "44%") reg = td.innerText | |
if (td.width == "20%") rollno = td.innerText | |
if (subjects == null){ | |
if (td.style.fontSize == "12px" && td.style.fontWeight == "bold" ) { | |
if (td.innerText .startsWith ("Subjects")) { | |
subjects = td.innerText | |
console.log (subjects) | |
list [reg] = { | |
rollno: rollno, | |
subjects: subjects | |
} | |
continue | |
} | |
} | |
} | |
} | |
} | |
} | |
list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment