Created
January 19, 2019 01:16
-
-
Save holaontiveros/26859e4d13fa69545b3f1a2fc2e35315 to your computer and use it in GitHub Desktop.
Function to download a bunch of images from an array of urls
This file contains hidden or 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
const downLoadImages = (links, title = 'img') => { | |
links.forEach((element, i) => { | |
const a = document.createElement('a'); | |
a.setAttribute('href', element); | |
a.setAttribute('download', `${title}_${i}.png`); | |
document.body.appendChild(a); | |
a.click(); | |
a.remove(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment