Guest User

Untitled

a guest
Mar 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. # tPortmonetka - przejazdy
  2.  
  3. # range of positions: position() >= 100 and not(position() > 200)
  4. # get last column
  5. let cost_col = $x("//*[@id='dataTable']//tr[position() >= 100 and not(position() > 200)]/td[last()]/div");
  6.  
  7. # parse to float
  8. let float_cost_col = cost_col.map(el => parseFloat(el.innerText.replace(',', '.')));
  9.  
  10. # sum
  11. let cost_sum = float_cost_col.reduce((el1, el2) => el1 + el2, 0).toFixed(2);
  12.  
  13. # oneliner
  14. calculate = $x("//*[@id='dataTable']//tr[position()>=13]/td[last()]/div").map(el => parseFloat(el.innerText.replace(',', '.'))).reduce((el1, el2) => el1 + el2, 0).toFixed(2)
Add Comment
Please, Sign In to add comment