Skip to content

Instantly share code, notes, and snippets.

@nodaguti
Last active February 9, 2017 04:08
Show Gist options
  • Save nodaguti/e7cc2edc7b5a0b642e0f801fecad1b27 to your computer and use it in GitHub Desktop.
Save nodaguti/e7cc2edc7b5a0b642e0f801fecad1b27 to your computer and use it in GitHub Desktop.
zuknow.net to CSV
/**
* 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