function transactionToCsv() {
    const txs = document.querySelectorAll('div[name="postedTransactions"] tr[name="DataContainer"]');
    const csv = Array.from(txs).map(tx => {
        const date = tx.querySelector('div[name="Transaction_TransactionDate"]').textContent.trim();
        const payer = tx.querySelector('div[name="Transaction_CardName"]').textContent.trim();
        const desc = tx.querySelector('div[name="Transaction_TransactionDescription"]').textContent.trim().replace(/\s+/g, ' ');
        const amount = tx.querySelector('div[name="Transaction_Amount"]').textContent.trim();
        return [toISODate(date), payer, desc, amount].map(e => `"${e}"`).join(',');
	});
    return csv.join('\n');
}
/**
 * Scrape posted transactions on the page and convert them to a CSV string
 */
Scrape posted transactions on the page and convert them to a CSV string
Scrape posted transactions on the page and convert them to a CSV string
function transactionToCsv() {
    const txs = document.querySelectorAll('div[name="postedTransactions"] tr[name="DataContainer"]');
    const csv = Array.from(txs).map(tx => {
        const date = tx.querySelector('div[name="Transaction_TransactionDate"]').textContent.trim();
        const payer = tx.querySelector('div[name="Transaction_CardName"]').textContent.trim();
        const desc = tx.querySelector('div[name="Transaction_TransactionDescription"]').textContent.trim().replace(/\s+/g, ' ');
        const amount = tx.querySelector('div[name="Transaction_Amount"]').textContent.trim();
        return [toISODate(date), payer, desc, amount].map(e => `"${e}"`).join(',');
	});
    return csv.join('\n');
}
function transactionToCsv ( ) { const txs = document . querySelectorAll ( 'div[name="postedTransactions"] tr[name="DataContainer"]' ) ; const csv = Array . from ( txs ) . map ( tx => { const date = tx . querySelector ( 'div[name="Transaction_TransactionDate"]' ) . textContent . trim ( ) ; const payer = tx . querySelector ( 'div[name="Transaction_CardName"]' ) . textContent . trim ( ) ; const desc = tx . querySelector ( 'div[name="Transaction_TransactionDescription"]' ) . textContent . trim ( ) . replace ( / \s+ / g , ' ' ) ; const amount = tx . querySelector ( 'div[name="Transaction_Amount"]' ) . textContent . trim ( ) ; return [ toISODate ( date ) , payer , desc , amount ] . map ( e => ` ${ e } ` ) . join ( ',' ) ; } ) ; return csv . join ( '\n' ) ; }
Scrape posted transactions on the page and convert them to a CSV string
Scrape posted transactions on the page and convert them to a CSV string