Skip to content

Instantly share code, notes, and snippets.

@vasilvestre
Last active July 11, 2019 20:42
Show Gist options
  • Save vasilvestre/c5f2e43779c4b4781a70735711dde9c9 to your computer and use it in GitHub Desktop.
Save vasilvestre/c5f2e43779c4b4781a70735711dde9c9 to your computer and use it in GitHub Desktop.
Script notes agora
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);
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