我试着用幻影节点来捕捉屏幕。在我的组件中,我导入const phantom = require('phantom');。点击后我想要运行方法-
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();
});
});
});
});
}但我还是犯了个错误-
webpack:///./~/phantomjs-prebuilt/lib/phantomjs.js?:8 Uncaught Error: Cannot find module "fs"(…)有什么建议怎么办?
https://stackoverflow.com/questions/41032928
复制相似问题