Created
December 11, 2015 08:10
-
-
Save LeiHao0/23ccc9493f2e73ca21b2 to your computer and use it in GitHub Desktop.
get All Images Url of a webpage
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 list=[]; | |
| var a=document.getElementsByTagName('img'); | |
| for (var i=0,l=a.length;i<l;i++) | |
| { | |
| if (/\.(jpg|gif|png|jpeg)$/im.test(a[i].getAttribute('src'))) | |
| { | |
| list.push(a[i].getAttribute('src')); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment