0
我想用phantomjs節點來捕獲屏幕。在我的組件我進口const phantom = require('phantom');
。然後,點擊之後我想運行方法 -reactjs - phantomjs-node問題與「FS」模塊
printOnePage(){
phantom.create().then(function(ph) {
ph.createPage().then(function(page) {
page.open('https://stackoverflow.com/').then(function(status) {
console.log(status);
page.property('content').then(function(content) {
console.log(content);
page.close();
ph.exit();
});
});
});
});
}
但我仍然gettint錯誤 -
webpack:///./~/phantomjs-prebuilt/lib/phantomjs.js?:8 Uncaught Error: Cannot find module "fs"(…)
任何提示,怎麼辦?