Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eliashussary/5b099d8eecad4bee0e90617d8ff802c8 to your computer and use it in GitHub Desktop.
Save eliashussary/5b099d8eecad4bee0e90617d8ff802c8 to your computer and use it in GitHub Desktop.
// paste in chrome console.
let answers = Array.prototype.slice
.call(
document.querySelectorAll(
"table > tbody > tr > td > table > tbody > tr > td:nth-child(2)[valign='top'] > div > span.correctAnswerFlag"
)
)
.reduce((acc, n) => {
const node = n.parentNode.children[2]
if (node.innerHTML.indexOf("<label") > -1) {
acc.push(node.innerText)
}
return acc
}, [])
let payload = Array.prototype.slice
.call(
document.querySelectorAll(
"table > tbody > tr:nth-child(2) > td:nth-child(2) > div.vtbegenerated.inlineVtbegenerated"
)
)
.map((node, index) => {
return `${index + 1}. ${node.innerText.replace('\n','')}\ta: ${answers[index]}`
})
.join("")
console.log(payload)
copy(payload)
@sssxsss666
Copy link

i get this "undefined" text

any help?

@nridawcc
Copy link

nridawcc commented Aug 3, 2020

same^

@GODfataliti
Copy link

same^

@JajoScript
Copy link

same^

@Kiddogod
Copy link

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment