Created
February 21, 2012 17:46
-
-
Save moondev/1877653 to your computer and use it in GitHub Desktop.
shotty2.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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