Skip to content

Instantly share code, notes, and snippets.

@BienGudBoy
Forked from dajo/quizlet-scraper.js
Created April 23, 2023 11:01
Show Gist options
  • Save BienGudBoy/fd0903a2ae77952fd39fc381aa6fc7fd to your computer and use it in GitHub Desktop.
Save BienGudBoy/fd0903a2ae77952fd39fc381aa6fc7fd to your computer and use it in GitHub Desktop.
Quizlet to CSV
/**
* Convert a list on Quizlet into CSV-formatted text.
* Usage:
* i) Copy and paste into your browser's console.
* ii) Run it!
*/
(() => {
const terms = document.getElementsByClassName('term');
const csv = [];
Array.from(terms).forEach((term) => {
const word = term.querySelector('.SetPageTerm-wordText').textContent.replace(/[\n\r]+/g, '/');
const def = term.querySelector('.SetPageTerm-definitionText').textContent.replace(/[\n\r]+/g, '/');
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