0
속성 변경을 위해 페이지를 계속 확인하는 데 문제가 있었지만 수행했습니다. 이제 내 주요 코드는 다음과 같습니다if 문 다음에 오는 작업 수행 CasperJS
casper.thenOpen('pageurl', function() {
this.then(function() {
function checkReload()
{
var cur = this.getElementAttribute("classname", "attr");
if (cur == "target") {here
return; // finished
}
else
{
this.echo(cur);
}
this.reload();
this.wait(1, checkReload); // check again in a second
}
this.then(checkReload);
}).thenEvaluate(function(){
this.click("#new_add");
this.echo("done567");
this.then.waitForSelector(".cartGdList",
function pass() {
this.click("...");
this.echo("done8");
this.then(function() {
this.waitForSelector(".cart_s_Box",
function pass() {
this.click("#js_upFormBtn");
this.echo("step4");
var end = new Date().getTime();
var time = end - start;
this.echo('time: ' + time + 'ms*');
},
function fail() {
this.echo('fail');
}
);
});
},
function fail() {
this.echo('fail');
}
);
});
});
그리고 문이 확인 될 경우 후 if(cur == "target")
나는이 코드를 수행 할 :이 작업을 수행 할 수 있습니다, 나는이를 넣어 시도하는 방법
this.click("#new_add");
this.echo("done567");
this.then.waitForSelector(".cartGdList",
function pass() {
this.click("...");
this.echo("done8");
this.then(function() {
this.waitForSelector(".cart_s_Box",
function pass() {
this.click("#js_upFormBtn");
this.echo("step4");
var end = new Date().getTime();
var time = end - start;
this.echo('time: ' + time + 'ms*');
},
function fail() {
this.echo('fail');
}
);
});
},
function fail() {
this.echo('fail');
}
);
을 thenEvaluate
에 있지만 이것은 작동하지 않습니다.
완벽 솔루션을 제공하지만이 코드 뒤에 – kaska3er
을 보내 주셔서 감사합니다. – kaska3er
'this.click ("# js_upFormBtn");' 'this.echo ("step4");' 실행 기능의 표시 시간이 있지만 에코 시간이 없습니다. – kaska3er