[英]Casper.js WaitFor X or Y
I now can trigger set of actions when 'AM' appears on the site. 现在,当网站上出现“ AM”时,我可以触发一组操作。 How do I do it if I need either 'AM' or 'PM' to trigger the action. 如果我需要“ AM”或“ PM”来触发操作,该怎么办。
casper.waitForText('AM', function() {
this.echo('found AM');
//do stuff
});
casper.waitForText()
supports also regular expressions: casper.waitForText()
还支持正则表达式:
casper.waitForText(/[AP]M/, function(){
this.echo('found [AP]M');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.