2013-08-12 2 views

답변

11

이 같은 것을보십시오 :

// 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

+0

기본적으로 호출하고 자바 스크립트 함수를 평가 내부. 내가하고 싶은 것은 명령 행에 alert() 기능과 비슷한 변수 값을 표시하는 것을 넣는 것이다. – user2129794

+0

이 기능이 작동하지 않는 이유는 무엇입니까? – hexid

+0

시도했지만 사용 방법을 알아낼 수 없습니다. – user2129794

관련 문제