Last active
July 11, 2019 20:42
-
-
Save vasilvestre/c5f2e43779c4b4781a70735711dde9c9 to your computer and use it in GitHub Desktop.
Script notes agora
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
var rows = document.querySelectorAll("#listTab_319776288 > tbody > tr"); | |
var output = 'init'; | |
var notes = 0; | |
var notesParUe = 0; | |
var nbNotesParUe = 0; | |
rows.forEach(function(row) { | |
var columns = row.querySelectorAll("td"); | |
if (columns.length === 1) { | |
if (output !== '') { | |
//console.log(notesParUe);console.log(nbNotesParUe); | |
output += parseInt(notesParUe/nbNotesParUe); | |
console.log(output); | |
notesParUe = 0; | |
nbNotesParUe = 0; | |
output = ''; | |
output += columns[0].innerText + ' '; | |
} | |
} else { | |
var note = parseFloat(columns[2].querySelector("div").innerText); | |
if (note) { | |
notesParUe = notesParUe + note; | |
nbNotesParUe++; | |
} | |
} | |
}); | |
output += parseInt(notesParUe/nbNotesParUe); | |
console.log(output); |
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
var rows = document.querySelectorAll("#listTab_319776288 > tbody > tr"); | |
var output = 'init'; | |
rows.forEach(function(row) { | |
var columns = row.querySelectorAll("td"); | |
if (columns.length === 1) { | |
if (output !== '') { | |
console.log(output); | |
output = ''; | |
output += columns[0].innerText + ' '; | |
} | |
} else { | |
if (columns[2].querySelector("div").innerText) { | |
output += columns[2].querySelector("div").innerText + ' '; | |
} | |
} | |
}); | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment