Last active
December 28, 2015 23:38
-
-
Save adrienjoly/7579919 to your computer and use it in GitHub Desktop.
scrape payment history from HSBC website (limited to 2 months, unfortunately...)
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
var lines = []; | |
var win = document.getElementsByName("FrameWork")[0].contentWindow; | |
var doc = win.document; | |
function nextPage() { | |
//doc.getElementsByClassName("pagination")[0].getElementsByTagName("a") | |
win.location.href = "javascript:suivante()"; | |
} | |
function scrapeLine(tr) { | |
var line = []; | |
for (var i=0;i<tr.children.length;++i) | |
line.push(tr.children[i].innerText); | |
return line; | |
} | |
function appendLines() { | |
var trs = doc.getElementsByTagName("tr"); | |
for (var i=0;i<trs.length;++i) | |
lines.push(scrapeLine(trs[i])); | |
console.log("appended lines starting after date:", lines[0][0]); | |
} | |
appendLines(); | |
nextPage(appendLines); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment