Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. var rows = document.querySelectorAll("#listTab_319776288 > tbody > tr");
  2. var output = 'init';
  3. var notes = 0;
  4. var notesParUe = 0;
  5. var nbNotesParUe = 0;
  6. rows.forEach(function(row) {
  7. var columns = row.querySelectorAll("td");
  8. if (columns.length === 1) {
  9. if (output !== '') {
  10. //console.log(notesParUe);console.log(nbNotesParUe);
  11. output += parseInt(notesParUe/nbNotesParUe);
  12. console.log(output);
  13. notesParUe = 0;
  14. nbNotesParUe = 0;
  15. output = '';
  16. output += columns[0].innerText + ' ';
  17. }
  18. } else {
  19. var note = parseFloat(columns[2].querySelector("div").innerText);
  20. if (note) {
  21. notesParUe = notesParUe + note;
  22. nbNotesParUe++;
  23. }
  24. }
  25. });
  26. output += parseInt(notesParUe/nbNotesParUe);
  27. console.log(output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement