【发布时间】:2025-12-16 02:00:01
【问题描述】:
A.html
<input type="submit" name="testLabel" value="Print Test" id="testLabel" onclick="myFunction('<?php echo $dynamic_page;?>')" >
<script>
function myFunction(page) {
var strWindowFeatures = "location=yes,height=570,width=520,scrollbars=yes,status=yes";
window.open(page, "_blank",strWindowFeatures);
}
</script>
CasperJS 代码
var casper = require('casper').create();
casper.start('http://localhost/test/a.html', function() {
this.echo(this.getTitle());
});
casper.thenClick('#testLabel');
casper.then(function() {
this.capture('page.png');
});
casper.run();
我也尝试过使用 phantomjs,但我无法在 page.png 中捕获 b.html 页面
注意:弹出页面名称不固定。
【问题讨论】:
-
但在真正的问题弹出屏幕是空白弹出在加载内容时需要时间如何解决这个问题