Dear Monks I am trying to get content of a url that I can view on my browser for some time (till the cookie expires I guess) but need to get through LWP. I have copied the cookies.txt file from mozilla profiles and using that to pretend that LWP was used for authntication. --------------------------------
my $url = 'http://www.princetonreview.com/schools/college/CollegeAdmis +sions.aspx?iid=1023828&uidbadge=%07'; my $browser = LWP::UserAgent->new; $browser->agent('Mozilla/4.76 [en] (Win98; U)'); my $cookie_jar = HTTP::Cookies::Mozilla->new(qw( autosave 1 file cooki +es.txt ) ); $browser->cookie_jar( $cookie_jar ); my $response = $browser->get( $url ); print $response->content;
--------------------------------- The resulting content is always the same authentication page asking for username and password but not the real page. As you can see I am not using authentication in my code but want to make use of already authenticated session that I started on mozilla. Any help would be appreciated. Thanks

In reply to How to get password protected content via LWP - by emulating my own browser (that can view that content) by Prat824

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.