Last active
December 17, 2018 16:51
-
-
Save dhbradshaw/a0892054e992938e03c73e8399c45e81 to your computer and use it in GitHub Desktop.
Array of img urls from JS console
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
// Get html collection of images: | |
var imgs = document.getElementsByTagName('img') | |
// Convert to array | |
imgs = Array.from(imgs) | |
// Map to urls | |
var urls = imgs.map(img => img.src) | |
// Copy to clipboard | |
copy(urls) | |
// Putting it all together: | |
copy(Array.from(document.getElementsByTagName('img')).map(img => img.src)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment