我安装了PhantomJS,并且示例脚本the official Phantom website工作正常。PhantomJS截图始终为空
我试图让this screenshot example工作:
var page = require('webpage').create();
page.open('http://github.com/', function() {
page.render('github.png');
phantom.exit();
});
但我不断收到一个空白github.png文件称重582KB
任何想法?
你能上传png文件吗?如果它很大,它可能不是空白的。 – phihag
也许URL需要是'https:// github.com /',因为GitHub现在可以安全地提供服务。 –
为了避免这种猜测,我只是用最新的PhantomJS尝试了这个确切的代码,它对我来说工作正常。 – smarx