Created
March 16, 2014 22:02
-
-
Save jmgunn87/9590509 to your computer and use it in GitHub Desktop.
scrape all the statements!
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
function Transaction(data) { | |
this.paidIn = parseFloat(data.paidIn); | |
this.paidOut = parseFloat(data.paidOut); | |
this.balance = parseFloat(data.balance); | |
this.description = data.descritpion; | |
this.Date = data.date; | |
this.type = data.type; | |
} | |
//turm 'em all into CSV | |
$('.hsbcRowSeparator tbody tr a').each(function (i, a) { | |
var month = []; | |
var html = $.ajax({ type: "GET", url: a.href, async: false }).responseText; | |
var table = $($(html).find('table')[1]); | |
table.find('tr').each(function (i, r) { | |
var transaction = []; | |
$(r).find('td').each(function (i, d) { | |
transaction.push($.trim(d.textContent)); | |
}); | |
month.push(transaction.join(',')); | |
}); | |
console.log(month.join('\n')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment