Skip to content

Instantly share code, notes, and snippets.

@ariya
Created Jan 30, 2013
Embed
What would you like to do?
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