Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement