Skip to content

Instantly share code, notes, and snippets.

@FusRoDah061
Created May 8, 2019 23:54
Show Gist options
  • Select an option

  • Save FusRoDah061/20d26aea8ce4176e22242fcb25ec43b3 to your computer and use it in GitHub Desktop.

Select an option

Save FusRoDah061/20d26aea8ce4176e22242fcb25ec43b3 to your computer and use it in GitHub Desktop.
Download all books from https://books.goalkicker.com/. Paste the code on developers console at goalkick homepage
/*
Download all books from https://books.goalkicker.com/
*/
var a = document.getElementsByClassName('bookContainer');
a = Array.from(a);
var links = a.map((item) => item.children[0]);
var livros = links.map(
item => {
let sub = item.href + item.href.substring(item.href.indexOf('/', 10)).replace('Book', 'NotesForProfessionals.pdf').trim();
return sub.substring(0, sub.length - 1);
}
);
for(let i = 0; i < links.length; i++){
links[i].href = "";
links[i].href = livros[i];
}
for(let i = 0; i < links.length; i++){
links[i].click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment