Last active
April 16, 2025 06:51
-
-
Save nodaguti/7b54519da2dee93e23bc to your computer and use it in GitHub Desktop.
Quizlet to CSV
This file contains 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 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('.qWord').textContent.replace(/[\n\r]+/g, '/'); | |
const def = term.querySelector('.qDef').textContent.replace(/[\n\r]+/g, '/'); | |
csv.push(`"${word}","${def}"`); | |
}); | |
console.log(csv.join('\n')); | |
})(); |
Replace SetPageTerms-term
with SetPageTermsList-term
to make those work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
June '24 update:
Bonus: automatically copy to clipboad: