Skip to content

Instantly share code, notes, and snippets.

@yask123
Last active December 19, 2023 04:02
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 yask123/49b71bfb525300f84422 to your computer and use it in GitHub Desktop.
Save yask123/49b71bfb525300f84422 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