Last active
August 29, 2015 13:56
-
-
Save hubgit/8953388 to your computer and use it in GitHub Desktop.
Download files from Google search results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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