Last active
February 29, 2020 16:02
-
-
Save paulopatto/69d7d03ce1b325ca5b1bced41494212d to your computer and use it in GitHub Desktop.
Snippet para pegar os tickers de FII do meu dashboard na corretora Rico.com.vc
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
/** | |
* Help resources: | |
* | |
* - https://medium.com/@chuckdries/traversing-the-dom-with-filter-map-and-arrow-functions-1417d326d2bc [best way] | |
* - https://css-tricks.com/snippets/javascript/loop-queryselectorall-matches/ | |
* - https://stackoverflow.com/questions/47008384/es6-filter-an-array-with-regex | |
* - https://rubular.com/ | |
*/ | |
const tickers = [] | |
const nlist = Array.from(document.querySelectorAll('table#tableAllocatedValue tbody tr td div')); | |
tickers = nlist.map( (node) => node.textContent).filter( (ticker) => ticker.match(/[\w]{4}11/) ) | |
/// Clearing data with VIm: | |
/// - :%s/, /\0\r/g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment