Skip to content

Instantly share code, notes, and snippets.

@dhbradshaw
Last active December 17, 2018 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhbradshaw/a0892054e992938e03c73e8399c45e81 to your computer and use it in GitHub Desktop.
Save dhbradshaw/a0892054e992938e03c73e8399c45e81 to your computer and use it in GitHub Desktop.
Array of img urls from JS console
// 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