Last active
October 16, 2020 04:44
-
-
Save stoft/6e7db40fca14f674c90b155c8557b542 to your computer and use it in GitHub Desktop.
Nordnet Extract
This file contains hidden or 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
[...document.getElementsByTagName('div')] | |
// NORDNET | |
.filter(e => e.getAttribute('role') === 'row') | |
.filter(e => !e.getAttribute('class').match('HeaderRow__|FooterRow__')) | |
.map(r => [...r.children]) | |
.map(cells => cells[1].innerText + '\t' + cells[8].innerText.replace(/\s/, '') + '\t' + cells[3].innerText) | |
.join("\n") + "\nCash\t" + [...document.getElementsByTagName('h2')] | |
.filter((e) => e.innerText === "Tillgängligt för handel")[0] | |
.parentNode.parentNode.childNodes[1].getElementsByTagName('span')[1].textContent.replace(/(\s|SEK)/g,""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment