Skip to content

Instantly share code, notes, and snippets.

@dhyegocalota
Created January 3, 2018 20:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dhyegocalota/c3487b82d68f31e56b841e6beee7050d to your computer and use it in GitHub Desktop.
console.log(JSON.stringify(Object.values(Array.from(document.querySelectorAll('table:nth-child(2) tbody tr')).filter((x, i) => i > 2).map(x => ({ code: x.querySelector('td:nth-child(1)').innerText.trim(), name: x.querySelector('td:nth-child(2)').innerText.trim() })).filter(x => x.code.length).reduce((acc, x) => { acc[x.code] = x; return acc }, {})), null, 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment