Skip to content

Instantly share code, notes, and snippets.

@hubgit
Last active August 29, 2015 13:56
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 hubgit/8953388 to your computer and use it in GitHub Desktop.
Save hubgit/8953388 to your computer and use it in GitHub Desktop.
Download files from Google search results
var links = Array.prototype.filter.call(document.querySelectorAll('a'), function (a) {
var href = a.getAttribute('data-href') || a.getAttribute('href');
return href && href.match(/\.xls$/)
});
var run = function () {
console.log(links[0]);
links.shift().click();
if (links.length) window.setTimeout(run, 1000)
};
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment