Skip to content

Instantly share code, notes, and snippets.

@yask123
Created February 27, 2016 08:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yask123/252d1734355094e79659 to your computer and use it in GitHub Desktop.
Save yask123/252d1734355094e79659 to your computer and use it in GitHub Desktop.
var img_dom = document.getElementsByClassName('image-thumb-body');
var links = [];
for (var i = 0; i< img_dom.length;i++){
links.push(img_dom[i].src);
}
function downloadAll(urls) {
var link = document.createElement('a');
link.setAttribute('download', null);
link.style.display = 'none';
document.body.appendChild(link);
for (var i = 0; i < urls.length; i++) {
link.setAttribute('href', urls[i]);
link.click();
}
document.body.removeChild(link);
}
downloadAll(links);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment