I get the same results as JavaFan.

By overriding WWW::Mechanize, I determined that I don't get any redirect at all:

package MyWWWMechanize; use strict; use warnings; use WWW::Mechanize; our @ISA = qw( WWW::Mechanize ); #--------------------------------------------------------------------- +----- # redirect_ok - log redirect messages #--------------------------------------------------------------------- +----- sub redirect_ok { my ($self, $prospective_request, $response) = @_; # Call parent to do all the boring work. my $ok = $self->SUPER::redirect_ok($prospective_request, $response +); # Log it print "Redirect From: ".$response->as_string()."\n"; print "Redirect To: ".$prospective_request->as_string()."\n"; print "Redirect is ".($ok ? "Allowed" : "DENIED")."\n"; return $ok; } 1; package main; my $url='https://www.platts.com/Login.aspx?'; #my $mechanize = WWW::Mechanize->new(autocheck => 1); my $mechanize = MyWWWMechanize->new(autocheck => 1); $mechanize->cookie_jar(HTTP::Cookies->new); $mechanize->agent('Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1) G +ecko/20061010 (IKDhPmJcdw) Firefox/2.0'); my $response = $mechanize->get( $url ); my $html = $mechanize->content; print "$html \n";

Are you sure you're getting this redirect on a GET and not a POST? Have you messed around with requests_redirectable?


In reply to Re: How to avoid "301 moved parmanently " from HTTPS responce? by gmargo
in thread How to avoid "301 moved parmanently " from HTTPS responce? by nbipin78

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.