【问题标题】:Phantomjs 'killed' on run in ubuntu 12.04 not in windows 7Phantomjs 在 ubuntu 12.04 中运行时“杀死”而不是在 Windows 7 中
【发布时间】:2014-06-25 00:46:59
【问题描述】:

我正在通过 phantomjs 运行一个非常简单的脚本来获取带有 bing 地图的网页截图。

var page = require('webpage').create();
page.open('workfileNew.html', function() {
    page.render('output.jpg');
    phantom.exit();
});

它在 Windows 中运行良好,但我在 ubuntu 中得到了“Killed”。在这两个操作系统中,版本都是 1.9.7。

如果我将workFileNew.html 替换为www.google.com,那么它可以正常工作。

任何帮助将不胜感激!

【问题讨论】:

  • 您是否尝试过使用文件路径:file:///home/user/path/workfileNew.html?
  • 我可以尝试这个但升级内存解决了问题

标签: ubuntu crash phantomjs screenshot


【解决方案1】:

我发现了问题。我租用的 VPS 内存不足。以前它是 256 MB 内存。当我将内存升级到 1 GB 时,它运行良好。我想也可以降低图像的分辨率。

【讨论】:

    猜你喜欢
    • 2014-11-06
    • 2013-02-03
    • 2018-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-03
    相关资源
    最近更新 更多