Last active
July 24, 2022 15:05
-
-
Save saswata-dutta/5c8be8c0b23fda1819529947fb3d8184 to your computer and use it in GitHub Desktop.
extract csv from webpage table
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
rows = document.querySelectorAll('tr.???'); | |
cellText = cell => cell.innerText; | |
rowText = r => Array.from(r.getElementsByTagName("td"), c => cellText(c)).join('|'); | |
csv = Array.from(rows, row => rowText(row)).join("\n"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment