小编Nee*_*dey的帖子

设置机械化Phantomjs

我遇到了一个问题。我想使用WWW :: Mechanize :: PhantomJS。我将其设置如下。1.安装Strawberry和WWW :: Mechanize :: PhantomJS模块。2.下载PhantomJS zip,解压缩并设置phantomjs可执行文件的路径。3.创建了一个示例脚本,如下所示:

BEGIN{
$ENV{HTTPS_PROXY} = 'http://myproxyserver:port';
$ENV{HTTP_PROXY}  = 'http://myproxyserver:port';
}
use WWW::Mechanize::PhantomJS;
use Data::Dumper;
my $mech = WWW::Mechanize::PhantomJS->new();
$mech->get('http://google.com');
print Dumper $mech->content();
Run Code Online (Sandbox Code Playgroud)

但是当我执行此脚本时,出现以下错误:

Selenium server did not return proper status at C:/Strawberry/perl/site/lib/Selenium/Remote/Driver.pm line 395.
Run Code Online (Sandbox Code Playgroud)

我缺少什么。我假设此WWW :: Mechanize :: PhantomJS从环境中指定的路径启动phantomjs。

编辑:我卸载了WWW :: Mechanize :: PhantomJS并尝试再次安装,但得到以下输出:

t/00-load.t ................... ok
t/49-mech-get-file.t .......... # Testing with     C:\bin\phantomjs\phantomjs.exe
Selenium server did not return proper status at  C:/Strawberry/perl/site/lib/Selenium/Remote/Driver.pm line 395.
# Looks like your test exited with 9 …
Run Code Online (Sandbox Code Playgroud)

perl mechanize phantomjs

5
推荐指数
0
解决办法
802
查看次数

标签 统计

mechanize ×1

perl ×1

phantomjs ×1