Created
May 22, 2017 03:30
-
-
Save BelfordZ/fc65bb496ce247276f9e9afbaeab4497 to your computer and use it in GitHub Desktop.
get all the images from a webpage as an array
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
var a = document.getElementsByTagName('img'); var b = []; for (var i = 0; i < a.length; i++) { if (a[i].src.indexOf('http') !== -1) { b.push(a[i].src); } } console.log(`["${b.join(',')}"]`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment