Skip to content

Instantly share code, notes, and snippets.

@bantya
Last active April 30, 2017 17:07
Show Gist options
  • Save bantya/ed3ca7f4a5c58aaa2ad3e2edc0229dbf to your computer and use it in GitHub Desktop.
Save bantya/ed3ca7f4a5c58aaa2ad3e2edc0229dbf to your computer and use it in GitHub Desktop.
JS: CLI fun using javascript and Browser dev tools
// 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