Last active
April 30, 2017 17:07
-
-
Save bantya/ed3ca7f4a5c58aaa2ad3e2edc0229dbf to your computer and use it in GitHub Desktop.
JS: CLI fun using javascript and Browser dev tools
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
// https://www.sitepoint.com/command-line-api-fun-profit/ | |
// Debug the webpage and check that if the layout is as per desire or not. | |
[].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)}); | |
// Extract all the image sources of a web site | |
var pics = $$("img"); | |
// var pics = $$("img.-cx-PRIVATE-Photo__image"); // instagram images | |
for (pic in pics) { | |
console.log(pics[pic].src); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment