Skip to content

Instantly share code, notes, and snippets.

@djshaji
Created March 29, 2023 04:23
Show Gist options
  • Save djshaji/23a127f3430723413dd07fe899199734 to your computer and use it in GitHub Desktop.
Save djshaji/23a127f3430723413dd07fe899199734 to your computer and use it in GitHub Desktop.
// copy and paste in devtools snippets and run on the registration return list page.
rolls = []
regs = []
names = []
data = {}
subjects = []
photos = []
for (i of document.querySelectorAll ("tr")) {
for ( c of i.children) {
if (c.innerHTML.search ("<br>") != -1 && c.width == '24%' && c.height == '14')
names.push (c)
if (c.width == '9%' && c.height == '14')
rolls.push (c)
if (c.width == '12%' && c.height == '14')
regs.push (c)
if (c.height == '19' && c.style.fontSize == "11px"&&c.style.fontWeight == "bold") {
subjects.push (c)
}
}
}
for (i of document.getElementsByTagName ("img")) {
if (i.height == "54")
photos.push (i.src)
}
for (i = 0 ; i < regs.length ; i ++ ){
data [rolls [i].innerText] = {
reg: regs [i].innerText,
name: names [i].innerText,
subjects: subjects [i].innerText,
photo: photos [i]
}
}
// print the output, right click and copy object
data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment