WWW: Mechanize: Firefox can't connect
I am creating a short Perl Script. I am using a module
. When I instantiate the object, I find that the module is unable to establish a connection with the MozRepl component in Firefox.
My code looks like this:
use WWW::Mechanize::Firefox; my $mech = WWW::Mechanize::Firefox->new();
When I run the code the following error appears
Failed to connect to , problem connecting to "localhost", port 4242: Connection refused at /usr/local/share/perl/5.12.4/MoxRepl/Client.pm line 144'
I just installed and updated all the relevant programs I can think of
- Perl 5.12.4
- MozRepl extension for Firefox
- WWW :: Mechanize
- WWW :: Mechanize :: Firefox
I tried to configure my firewall to open port 4242. Nothing works. Any ideas?
A similar error code appears in this question
Ok, Borodin's answer actually fixed 2 problems.
WWW :: Mechanize :: Firefox-> new () only works when
- Firefox browser is already open and
- After Firefox starts, follow Borodin's instructions and also launch MozRepl
I expected the Perl script to act like a shell script and launch Firefox for me. This is not true.
Also, if you hide the menu bar in Firefox, the Tools menu is the only menu that is not available in the dropdown that appears in the top left corner. You must display the menu bar to access the Tools menu.
source to share