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,

In reply to Re^2: Processing page issue by pdilipm
in thread Processing page issue by pdilipm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.