phantomjs 仅适用于 windows

phantomjs works only on windows

我发现了一些奇怪的问题。我在 Windows 7 和 Ubuntu 16.04 上使用 PhantomJs v2.1.1。我尝试打开页面 https://my.avast.com,在 Windows 下它成功了,但在 Ubuntu 上它失败了。 我还尝试将 运行 示例 .js 脚本添加到 phantomjs2.1.1--.tar.gz 文件中,例如

phantomjs responsive-screenshot.js https://my.avast.com png

但没有成功 - 只有没有背景和文字的图像 Loading 已被写入。

您能否针对这种情况提出解决方法?

我的主要目标是在 headless linux 下登录 avast.com 页面。

尝试 运行 使用:--ignore-ssl-errors=true --ssl-protocol=any --debug=true

phantomjs --ignore-ssl-errors=true --ssl-protocol=any --debug=true responsive-screenshot.js https://my.avast.com png

您需要使用 onResourceError 回调来找出问题所在。