1
我试试这个非常简单的脚本:是'--remote-debugger-port'应该与casper 1.1.2和phantomjs 2.1.1一起使用?
debugger;
var casper = require('casper').create();
casper.on('remote.message', function(msg) {
this.echo('remote: ' + msg);
})
casper.start('http://stackoverflow.com');
casper.thenEvaluate(function(){
var ps = document.querySelectorAll('*');
console.log("DEBUG ps.length="+ps.length);
})
casper.run(function() {
this.exit();
});
然后我跑
casperjs --remote-debugger-port=9035 script.js
然后我在Chrome中打开http://127.0.0.1:9035,点击bootstrap.js
链接,然后打开console
选项卡,键入__run()
,但都得到挂起。
是这个功能应该正常工作?