2012-05-24 32 views

cevap

44

ben tam sorunuzu anlamak gerçekten emin değilim, ama aşağıdaki gibi bir şey yapabilirsiniz:

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(); 

Çıktı:

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

Benim için, gelen' görmüyorum tarayıcı ' –

+1

' this.echo' kullandığımda benim için çalışır, cevabınızı düzenledim. – jgillich

+0

Benim için de çalışıyor. Cevap kabul edilmeli. – kieste