如何在 Wight 中包含 `--ssl-protocol=any`?

How to include `--ssl-protocol=any` in Wight?

我正在尝试在不使用 Mechanize::Firefox 的情况下截取网页的屏幕截图。

我试过 Wight 模块,将与 PhantomJS 通信。

我可以拍摄 http: 个网站的屏幕截图,但无法拍摄 https: 个网站的屏幕截图。

我已经搜索过了,在这里找到了解决办法 也就是增加一个命令行选项

phantomjs --ssl-protocol=any  test.js

但我是 运行 Wight 模块中的 PhantomJS,我不知道如何在脚本中应用 --ssl-protocol

这是我试过的

use strict;

use Wight;

my %arg = ( phantomjs => 'phantomjs', protocal => '--ssl-protocol=any');
my $wight = Wight->new(%arg);

$wight->visit('https:...');

$wight->evaluate('document.title');
$wight->render('anv.png');

正确的做法是对新对象调用phantomjs_args,像这样

my $wight = Wight->new;
$wight->phantomjs_args( '--ssl-protocol=any' );