无法创建WWW实例:Mechanize :: Firefox

时间:2011-09-14 14:20:49

标签: perl automated-tests www-mechanize

我刚刚安装了WWW:Mechanize::Firefox,但是当我尝试创建这个“类”的实例时:

    my $mech = WWW::Mechanize::Firefox->new();

我收到此错误:

Failed to connect to , problem connecting to "localhost", port 4242: 
No connection could be made because the target machine 
actively refused it. 
at C:/strawberry/perl/site/lib/MozRepl/Client.pm line 144

有人可以帮忙吗?

2 个答案:

答案 0 :(得分:7)

您必须安装mozrepl并在菜单Tools → MozRepl → Start中启动它。

答案 1 :(得分:2)

除了安装和启动firefox / mozrepl之外,主动拒绝连接通常是FIREWALL的工作,因此您需要学习使用本地防火墙以允许mozrepl监听来自localhost的连接