0
CasperJS에서 (evaluate
을 사용하여) javascript 함수를 디버깅하려면 어떻게해야합니까?casperJS에서 javascript 함수를 디버깅하는 방법
alert()
과 비슷한 것이 있는데, 여기에 필요하면 명령 줄에 값을 인쇄 할 때 사용할 수 있습니까?
CasperJS에서 (evaluate
을 사용하여) javascript 함수를 디버깅하려면 어떻게해야합니까?casperJS에서 javascript 함수를 디버깅하는 방법
alert()
과 비슷한 것이 있는데, 여기에 필요하면 명령 줄에 값을 인쇄 할 때 사용할 수 있습니까?
이 같은 것을보십시오 :
// add this to the top of the script
casper.on('remote.message', function(msg) {
this.echo(msg);
})
casper.thenEvaluate(function() {
// and then add this to the evaluate to print a value
console.log('Testing...');
})
는 시도 - 캐치 이것을 사용하려면 다음 사용
casper.thenEvaluate(function() {
try {
throw "Some error...";
} catch(err) {
console.log(err);
}
})
출처 : CasperJS Documentation이
기본적으로 호출하고 자바 스크립트 함수를 평가 내부. 내가하고 싶은 것은 명령 행에 alert() 기능과 비슷한 변수 값을 표시하는 것을 넣는 것이다. – user2129794
이 기능이 작동하지 않는 이유는 무엇입니까? – hexid
시도했지만 사용 방법을 알아낼 수 없습니다. – user2129794