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