Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Method dive not found on WWW::Mechanize::Firefox / MozRepl::RemoteObject

by agaved (Novice)
on Apr 10, 2012 at 14:09 UTC ( [id://964325]=perlquestion: print w/replies, xml ) Need Help??

agaved has asked for the wisdom of the Perl Monks concerning the following question:

I tried to run:

use WWW::Mechanize::Firefox; my $mech = WWW::Mechanize::Firefox->new(); $mech->get('http://google.com'); $mech->eval_in_page('alert("Hello Firefox")'); my $png = $mech->content_as_png();

and got:

Can't locate object method "dive" via package "MozRepl::RemoteObject:: +Methods" at /usr/local/ActivePerl-5.12/site/lib/WWW/Mechanize/Firefox +.pm line 220, <DATA> line 1.

I have WWW::Mechanize::Firefox 0.65, MozRepl::RemoteObject::0.31, MozRepl::0.06 installed.

Any help is greatly appreciated.

Replies are listed 'Best First'.
Re: Method dive not found on WWW::Mechanize::Firefox / MozRepl::RemoteObject
by Corion (Patriarch) on Apr 10, 2012 at 14:18 UTC

    Ouch. It seems that this is broken and the version of MozRepl::RemoteObject that fixes this is not yet released on CPAN. The workaround fix is likely adding these lines at the start of your script until you can upgrade to v0.32 of MozRepl::RemoteObject:

    use MozRepl::RemoteObject; BEGIN { if( ! *MozRepl::RemoteObject::Methods::dive{ CODE } ) { *MozRepl::RemoteObject::Methods::dive = \&MozRepl::RemoteObjec +t::__dive; }; }; use WWW::Mechanize::Firefox;

      Make that:

      use MozRepl::RemoteObject; BEGIN { if( ! *MozRepl::RemoteObject::Methods::dive{ CODE } ) { *MozRepl::RemoteObject::Methods::dive = \&MozRepl::RemoteObjec +t::Instance::__dive; }; }; use WWW::Mechanize::Firefox;

        Should be fixed now, as v0.32 of MozRepl::RemoteObject is on its way to the CPAN mirrors.

      That worked.

      Many thanks indeed

      Adriano

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://964325]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-24 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found