Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # tPortmonetka - przejazdy
- # range of positions: position() >= 100 and not(position() > 200)
- # get last column
- let cost_col = $x("//*[@id='dataTable']//tr[position() >= 100 and not(position() > 200)]/td[last()]/div");
- # parse to float
- let float_cost_col = cost_col.map(el => parseFloat(el.innerText.replace(',', '.')));
- # sum
- let cost_sum = float_cost_col.reduce((el1, el2) => el1 + el2, 0).toFixed(2);
- # oneliner
- 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