Skip to content

Instantly share code, notes, and snippets.

Created Jan 30, 2013
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment