Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Reading a cookie from an active browser session

by xorl (Deacon)
on Nov 19, 2013 at 12:33 UTC ( [id://1063319]=note: print w/replies, xml ) Need Help??


in reply to Re: Reading a cookie from an active browser session
in thread Reading a cookie from an active browser session

So I installed the mozrepl plugin. telnet localhost 4242 seems to work fine. So I went to install the Perl module, but it won't install:
Result: FAIL Failed 81/86 test programs. 14/90 subtests failed. make: *** [test_dynamic] Error 2 CORION/WWW-Mechanize-Firefox-0.74.tar.gz one dependency not OK (MozRepl::RemoteObject); additionally test harne +ss failed /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports CORION/WWW-Mechanize-Firefox-0.74.tar.gz Running make install make test had returned bad status, won't install without force Failed during this command: ZIGOROU/MozRepl-0.06.tar.gz : make_test NO CORION/MozRepl-RemoteObject-0.37.tar.gz : make_test NO one depen +dency not OK (MozRepl) CORION/WWW-Mechanize-Firefox-0.74.tar.gz : make_test NO one depen +dency not OK (MozRepl::RemoteObject); additionally test harness faile +d cpan[2]> reports CORION/WWW-Mechanize-Firefox-0.74.tar.gz Distribution: C/CO/CORION/WWW-Mechanize-Firefox-0.74.tar.gz CPAN::DistnameInfo not installed; cannot continue

From what i could tell most fail with:

Can't locate MozRepl/RemoteObject.pm in @INC

So I tried installing MozRepl::RemoteObject

Result: PASS CORION/MozRepl-RemoteObject-0.37.tar.gz Tests succeeded but one dependency not OK (MozRepl) CORION/MozRepl-RemoteObject-0.37.tar.gz [dependencies] -- NA Running make install make test had returned bad status, won't install without force Failed during this command: ZIGOROU/MozRepl-0.06.tar.gz : make_test NO CORION/MozRepl-RemoteObject-0.37.tar.gz : make_test NO one depen +dency not OK (MozRepl)
so I tried installing just MozRepl
Result: FAIL Failed 5/14 test programs. 10/42 subtests failed. make: *** [test_dynamic] Error 255 ZIGOROU/MozRepl-0.06.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports ZIGOROU/MozRepl-0.06.tar.gz Running make install make test had returned bad status, won't install without force Failed during this command: ZIGOROU/MozRepl-0.06.tar.gz : make_test NO

There's so much gobliktygook from that one I can't make heads or tails as to what tests failed or why. I'd post it here but it is really really really long and I wouldn't expect anyone to look through it.

So basically I need another solution :(

Replies are listed 'Best First'.
Re^3: Reading a cookie from an active browser session
by Corion (Patriarch) on Nov 19, 2013 at 12:37 UTC

    MozRepl is not maintained by me. It fails its tests, I think mostly on Windows for a long time.

    I recommend you force-install MozRepl and then continue with the rest.

      Ok I did the force install. Now I tried the following code:
      use strict; use warnings; use Data::Dumper; $ENV{MOZREPL} = "localhost:8888"; # using a non-standard port since 4 +242 is used by ncui use HTTP::Cookies::MozRepl; my $repl = MozRepl::RemoteObject->install_bridge(); my $document = $repl->expr('document'); print $document->{title};

      This prints out the correct title: Junos Pulse Secure Access Service - Home - Mozilla Firefox

      So I added:

      my $cookie_jar = HTTP::Cookies::MozRepl->new( repl => $repl ); my @cookies = $cookie_jar->extract_cookies(); print Dumper \@cookies;

      Now it just hangs there, it doesn't even print the title.

      Any ideas what am I doing wrong?

      Thanks in advance.

        Maybe you just have a lot of cookies? HTTP::Cookies::MozRepl is slow.

        You could switch on the logging for your MozRepl client to see whether it is hanging or still doing something.

Re^3: Reading a cookie from an active browser session
by shagbark (Acolyte) on Jan 23, 2014 at 01:21 UTC
    I just installed WWW::Mechanize::Firefox v0.74 using cpan on Windows 7 under Cygwin, with no -force and no problem.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-03-29 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found