2012-05-24 8 views

答えて

44

私は完全にあなたの質問を理解することは本当にわからないんだけど、あなたは、次のような何かを行うことができます。

var casper = require('casper').create({ 
    logLevel: "debug" 
}); 

casper.on('remote.message', function(message) { 
    this.echo(message); 
}); 

casper.start('http://google.com/', function() { 
    this.evaluate(function sendLog(log) { 
     // you can access the log from page DOM 
     console.log('from the browser, I can tell you there are ' + log.length + ' entries in the log'); 
    }, this.result.log); 
}); 

casper.run(); 

出力:

$ casperjs log.js 
from the browser, I can tell you there are 4 entries 
+0

私にとっては、私はから」表示されませんブラウザ ' –

+1

'this.echo'を使うと私のために働きます。私はあなたの答えを編集しました。 – jgillich

+0

私のためにも動作します。答えを受け入れる必要があります。 – kieste

関連する問題