Skip to content

Instantly share code, notes, and snippets.

@joeperpetua
Last active March 15, 2024 06:28
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joeperpetua/3a1f6d514f86592ea253df6172453c98 to your computer and use it in GitHub Desktop.
Save joeperpetua/3a1f6d514f86592ea253df6172453c98 to your computer and use it in GitHub Desktop.
Export / Extract Vocabulary from Busuu

Export / Extract Vocabulary from Busuu Website

Steps:

  • Go to Review page: https://www.busuu.com/dashboard#/review
  • Mute the tab or the PC (when obtaining the audio links, they will be played out loud)
  • Open browser console (Ctrl + Shift + J)
  • Copy/Paste and Run the following code in the browser console:
const vocabList = document.querySelectorAll(".vocab-list-row");
let vocabToExport = [];

console.log("==========\nThis can take some time, depending on the amount of vocabulary there is to export, around 1 minute for 800 entries for example.\n==========");

for(let i = 0; i < vocabList.length; i++){

    vocabList[i]?.childNodes[2]?.firstChild?.firstChild?.lastChild?.firstChild.click();
    vocabList[i]?.childNodes[6]?.firstChild?.lastChild?.click();

    const vocabText = vocabList[i]?.children[3]?.children[0]?.children[0]?.textContent;
    const vocabTranslation = vocabList[i]?.children[3]?.children[1]?.textContent;
    const vocabStrength = vocabList[i]?.children[4]?.children[1]?.textContent;
    const vocabExampleTranslated = vocabList[i]?.children[6]?.children[1]?.children[1]?.textContent;
    const vocabOriginalExample = vocabList[i]?.children[6]?.children[1]?.children[0]?.textContent;
    const vocabAudioURL = vocabList[i]?.childNodes[2]?.firstChild?.firstChild?.lastChild?.firstChild?.getAttribute("src");
    const vocabExampleAudioURL = vocabList[i]?.childNodes[6]?.firstChild?.lastChild?.firstChild?.lastChild?.firstChild?.getAttribute("src");

    vocabToExport.push({
        "text": vocabText,
        "translation": vocabTranslation,
        "strength": vocabStrength,
        "example_translated": vocabExampleTranslated,
        "example": vocabOriginalExample,
        "audio": vocabAudioURL,
        "example_audio": vocabExampleAudioURL
    });
    
    console.log("<--- Entries processed");
}
console.log("==========\nProcess finished, you can copy the following object:");
console.log(vocabToExport);
console.log("==========");
  • Wait for the result to be logged in the console
  • This error message is expected, wait until all the errors are logged before unmuting the tab / PC:

image

  • Copy the logged object:

image

  • Go to JSON to CSV Converter and paste the copied object
  • Generate your Busuu vocabulary in CSV/xlsx format

That is pretty much all, you can do whatever you want with the CSV file (making an Anki deck for example). If you have any issues with the script, please create an issue in the repository.

@lucassha
Copy link

lucassha commented Jul 7, 2023

🐐 ty mate, worked perfectly

@joeperpetua
Copy link
Author

🐐 ty mate, worked perfectly

No problem, glad it was useful!

@erichlf
Copy link

erichlf commented Jul 24, 2023

I could not copy and paste the object, so I just changed the one line from console.log(vocabToExport); to console.log(JSON.stringify(vocabToExport));.

@erichlf
Copy link

erichlf commented Jul 26, 2023

The way I am doing things now is very specific to using a combination of anki and busuu.

My use case is this; I want to update my Anki deck with new words from Busuu. New words in Busuu are listed as "Weak Words", if you have studied your words they should be listed as "Medium Words" or "Strong Words". I use this to filter for new words, so that I can add them to my Anki deck.

To do this I do the following:

  1. In chrome go to www.busuu.com/dashboard#/review/weak
  2. CTRL + SHIFT + J
  3. Paste the following:
const vocabList = document.querySelectorAll(".vocab-list-row");
let vocabToExport = "";

console.log("==========\nThis can take some time, depending on the amount of vocabulary there is to export, around 1 minute for 800 entries for example.\n==========");

const width = 20;
for(let i = 0; i < vocabList.length; i++){
  vocabList[i]?.childNodes[2]?.firstChild?.firstChild?.lastChild?.firstChild.click();
  vocabList[i]?.childNodes[6]?.firstChild?.lastChild?.click();

  const vocabText = vocabList[i]?.children[3]?.children[0]?.children[0]?.textContent;
  const vocabTranslation = vocabList[i]?.children[3]?.children[1]?.textContent;

  vocabToExport = vocabToExport.concat("\n", vocabText, ";", vocabTranslation);
}
console.log("==========\nProcess finished, you can copy the following:");
console.log(vocabToExport);
console.log("==========");
  1. Copy the word list
  2. Save word list to an empty file
  3. Open Anki
  4. File->import
  5. Select file from step 5
  6. Make sure that everything is set the way you want it and be sure that correct Deck is selected.
  7. Profit

The first time you do this just select all words.

@ftaklamakan
Copy link

Worked perfectly, thank you so much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment