in reply to Processing page issue

The relevant part of the "processing" page is

<META http-equiv=Refresh content=3;URL=/gamma/z2xcmnmainam/index>

(which is horribly malformed HTML). You'll have to parse that part out and then request the appropriate page. Also, consider learning how HTTP and HTML interact and how browsers usually behave.

Replies are listed 'Best First'.
Re^2: Processing page issue
by pdilipm (Initiate) on May 30, 2012 at 10:18 UTC
    Thank you for the tips. To start with, I hardcoded the URL to see if it works:
    my $homepage = "https://xxx/gamma/z2xcmnmainam/index"; $m->get($homepage); print $m->content();
    This worked and I'm able to see the homepage! Now, I need to make it more generic for it to be able to work with any URL. I tried to use WWW::Mechanize::Plugin::FollowMetaRedirect $m->get($url); $m->follow_meta_redirect; But while trying to run, it gives me this error: Can't locate WWW/Mechanize/Pluggable.pm in @INC (@INC contains: C:/Dwimperl/perl /site/lib C:/Dwimperl/perl/vendor/lib C:/Dwimperl/perl/lib .) Could you please suggest how to fix this error? I also tried to parse the HTML for URL:
    use WWW::Mechanize; #use WWW::Mechanize::Plugin::FollowMetaRedirect; use strict; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0; my $m = WWW::Mechanize->new(autocheck => 1); $m->add_header( "Connection" => "keep-alive", "Keep-Alive" => "115 +"); my $url="https://rp6.bench.ehc.adp.com/siteminderagent/forms/LSPRH3/lo +gin.fcc?TYPE=33554433&REALMOID=06-7d0449cd-e3ed-10fb-9f50-8498490a0cb +3&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-s2uV8pMx7pQ%2byUUrf +iIGkme9FfRRMzZ8AkgpHMTZaaKvrgCvd%2fA99CuE2IG3sVvp&TARGET=-SM-https%3a +%2f%2frp6%2ebench%2eehc%2eadp%2ecom%2findex_lsprh%2ehtml"; print "$INC{'WWW/Mechanize.pm'}\n"; $m->get($url); #$m->follow_meta_redirect; $m->success or die "login GET fail"; my $user='bdos0101-b01'; my $pass='bench_0'; my $login = $m->form_name("loginform"); $m->forms; $m->form_name('loginform'); $login->value('USER' => $user); $login->value('password' => $pass); $m->submit(); $m->success or die "login POST fail"; print "Login done\n"; #print $response->content(); if ($m =~ m!<meta\s+http-equiv=['"]refresh["']\s+content="\d+;([^"]+)" +!si) { warn "Refresh found (-> $1), following"; my $target = $1; $m->get($target); }; print $m->content();
    But it prints the processing page itself. Regards,

      What part of the error message do you have problems with?

      Can't locate WWW/Mechanize/Pluggable.pm in @INC (@INC contains: C:/Dwi +mperl/perl /site/lib C:/Dwimperl/perl/vendor/lib C:/Dwimperl/perl/lib + .

      How did you install WWW::Mechanize::Plugin::FollowMetaRedirect? Usually, Perl modules list all the other Perl modules they rely on and the Perl installation mechanisms follow these so-called pre-requisites and install them as well.

      If you did not use the installation mechanisms provided by Perl (cpan, cpanp or cpanm), please use them.