Skip to content

Instantly share code, notes, and snippets.

@stoft
Last active October 16, 2020 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stoft/6e7db40fca14f674c90b155c8557b542 to your computer and use it in GitHub Desktop.
Save stoft/6e7db40fca14f674c90b155c8557b542 to your computer and use it in GitHub Desktop.
Nordnet Extract
[...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