Skip to content

Instantly share code, notes, and snippets.

@ariya
Created January 30, 2013 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariya/4675965 to your computer and use it in GitHub Desktop.
Save ariya/4675965 to your computer and use it in GitHub Desktop.
PhantomJS script to print the source of the first image
var page = require('webpage').create();
page.content = '<html><body><img src="foo.png">';
console.log(page.evaluate(function () {
return document.images[0].src;
}));
phantom.exit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment