SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Convert a list on Quizlet into CSV-formatted text.
  3.  * Usage:
  4.  *   i) Copy and paste into your browser's console.
  5.  *   ii) Run it!
  6.  */
  7. (() => {
  8.   const terms = document.getElementsByClassName('SetPageTerm-inner');
  9.   const csv = [];
  10.  
  11.   Array.from(terms).forEach((term) => {
  12.     const word = term.querySelector('.SetPageTerm-wordText').textContent.replace(/[\n\r]+/g, '/');
  13.     const def = term.querySelector('.SetPageTerm-definitionText').textContent.replace(/[\n\r]+/g, '/');
  14.  
  15.     csv.push(`"${word}","${def}"`);
  16.   });
  17.  
  18.   console.log(csv.join('\n'));
  19. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top