Created
May 9, 2018 22:27
-
-
Save eliashussary/5b099d8eecad4bee0e90617d8ff802c8 to your computer and use it in GitHub Desktop.
This file contains 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
// 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) |
same^
same^
same^
same
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i get this "undefined" text
any help?