I'd like to know ways to dump an instance of an LWP::UserAgent or WWW::Mechanize browser session to a new browser or tie it to an existing one (cookies, etc)
This is use LWP up to a certain point where to let users browse from
i've tried the following but, although it works, the session does not last ( I assume browser actually has no cookie at all) and i get redirected to login page
#!c:\\perl\\bin\\perl.exe -w use strict; use diagnostics; use WWW::Mechanize; my $mech = WWW::Mechanize->new( autocheck => 1 , agent_alias => "Windows IE 6" , noproxy => 1 ); my $url= shift; # lwp actual navigation # request login page # fill in user and password # submit $mech->get( $url ); $mech->field( 'user_field_name', shift ); $mech->field( 'pwd_field_name' , shift ); $mech->submit; # launch a browser... system('start iexplore.exe '. $mech->uri.";jsessionid=".$mech->cookie_ +jar->{'COOKIES'}->{'server'}->{'/webapp'}->{'JSESSIONID'}->[1]);
In reply to dump lwp::useragent to browser by lolailo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |