Skip to content

Instantly share code, notes, and snippets.

@alandooz
Last active August 12, 2021 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandooz/f2da8475c3997f75b67e9d03dfb57145 to your computer and use it in GitHub Desktop.
Save alandooz/f2da8475c3997f75b67e9d03dfb57145 to your computer and use it in GitHub Desktop.
format CSV
let books = [...document.querySelector('#g-items').querySelectorAll("li")].map(element => { let el = element.querySelector("[id^='itemName_']"); let author = element.querySelector("[id^='item-byline-']"); return [`"${el.title} by ${author.innerText}"`,el.origin+el.pathname.replace('-/es/','')]}).map(d => d.join()).join('\n');
console.log(books)
Copy and paste
Put "title,url" at the first line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment