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



我刚刚安装了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

有人能帮忙吗?

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

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

的连接。

最新更新