1 // Read the Phantom webpage '#intro' element text using jQuery and "includeJs"
3 var page = require('webpage').create();
5 page.onConsoleMessage = function(msg) {
9 page.open("http://www.phantomjs.org", function(status) {
10 if ( status === "success" ) {
11 page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {
12 page.evaluate(function() {
13 console.log("$(\"#intro\").text() -> " + $("#intro").text());