0
我想捕獲每個頁面上的屏幕截圖。爲了導航到不同的頁面,有一個功能moveNext()
。當我檢查控制檯時,我能夠看到它按順序導航到所有頁面。但是,它並不是在每個頁面上同時進行屏幕截圖,而是需要最後一頁的多個屏幕截圖。 casperjs是否提供回叫或等待選項?PhantomCSS屏幕截圖在循環內不能正常工作
casper.then(function() {
for (var currentPage = startPage; currentPage < lastPage; currentPage++) {
this.page.evaluate(function(currentPage) {
moveNext(currentPage);
}, currentPage);
phantomcss.screenshot('html', 'screenshot');
console.log(currentPage);
}
});