Here is my script
var casper = require('casper').create({
clientScripts: [
'/Path/to/JQuery/Test/jquery-2.0.3.js'
],
logLevel: "info",
logLevel: "debug",
verbose: true
});
casper.start("http://www.google.com", function(){
console.log(this.evaluate((function() {
$( window ).load(function(){
return "======Page"+$('title').text()+"=========" ;
});
})));
});
casper.run();
Result in console
[info] [phantom] Step anonymous 2/2 http://www.google.com/ (HTTP 200)
null
[debug] [phantom] Automatically injected /Path/to/JQuery/Test/jquery-2.0.3.js client side
[debug] [phantom] Automatically injected /Path/to/JQuery/Test/jquery-2.0.3.js client side
[info] [phantom] Done 2 steps in 1154ms
My function returns a null value? Help ?? Thanks