Created
January 5, 2022 10:54
-
-
Save brunoluiz/f35c2bc1f9a38ac1b99a47a30cd08239 to your computer and use it in GitHub Desktop.
amex-check-statement-values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let paymentReceivedRowId = 0; | |
document.querySelectorAll('div.col-md-5.col-sm-8.pad-responsive-lr.pad-1-t-sm-down').forEach((n, idx) => | |
n.textContent.includes('PAYMENT RECEIVED') ? paymentReceivedRowId = idx : null | |
); | |
// navigate to the statement view | |
let items = []; | |
document.querySelectorAll('div.col-md-3.col-sm-4.pad-responsive-r.flex.flex-column-md.flex-justify-end').forEach((n, idx) => { | |
if (idx === paymentReceivedRowId) return; | |
items.push(n.textContent.replaceAll('£','')); | |
}); | |
items.reduce((acc, item) => item !== '-1,899.31' ? acc + Number(item) : acc, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment