Last active
February 9, 2017 04:08
-
-
Save nodaguti/e7cc2edc7b5a0b642e0f801fecad1b27 to your computer and use it in GitHub Desktop.
zuknow.net to CSV
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
/** | |
* Convert a phrase list on zuknow.net into CSV-formatted text. | |
* Usage: | |
* i) Copy and paste into your browser's console. | |
* ii) Run it! | |
*/ | |
(() => { | |
const wrappers = document.getElementsByClassName('jsc-card-wrapper'); | |
const csv = []; | |
Array.from(wrappers).forEach((wrapper) => { | |
const word = wrapper.querySelector('.pg-card-table-main').textContent.trim(); | |
const def = wrapper.querySelector('.pg-card-table-answer').textContent.trim(); | |
csv.push(`"${word}","${def}"`); | |
}); | |
console.log(csv.join('\n')); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment