Skip to content

Instantly share code, notes, and snippets.

@moondev
Created February 21, 2012 17:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save moondev/1877653 to your computer and use it in GitHub Desktop.
Save moondev/1877653 to your computer and use it in GitHub Desktop.
shotty2.js
var page = new WebPage();
page.open('http://espn.go.com/nfl/', function (status) {
//once page loaded, include jQuery from cdn
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {
//once jQuery loaded, run some code
//inserts our custom text into the page
page.evaluate(function(){$("h2").html('Many NFL Players Scared that Chad Moon Will Enter League');});
//take screenshot and exit
page.render('espn.png');
phantom.exit();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment