Created
April 8, 2022 04:53
-
-
Save pigeonburger/43ff4a976867aa141ba3b0862c9d99d6 to your computer and use it in GitHub Desktop.
Quizlet to CSV file
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
/* | |
Converts a Quizlet set to a CSV file and downloads it to your computer. | |
HOW TO USE: | |
1. Open your browser's console | |
2. Copy all the below code into it, and press enter. | |
3. The list will be saved to your downloads as a CSV file! | |
*/ | |
const terms = document.getElementsByClassName('SetPageTerms-term'); | |
const csv = [`"term","definition"`]; | |
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}"`); | |
}); | |
var blob1 = new Blob([csv.join('\n')], { type: "text/plain;charset=utf-8" }); | |
var url = window.URL || window.webkitURL; | |
link = url.createObjectURL(blob1); | |
var a = document.createElement("a"); | |
a.download = `${document.querySelector('.SetPage-setTitle').textContent}.csv`; | |
a.href = link; | |
document.body.appendChild(a); | |
a.click(); | |
document.body.removeChild(a); |
Hey, when I use this column A is term, column B is definition. But under definition it just repeats the term. Any tips?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much for this 🥳