Mechanize doesn't meet my needs in this case (as far as I can tell). LWPcook was exactly what I needed -- see PROXIES.

The following got me logged in to the website programatically, which then allowed me to open the links in the site ($links) to view their content($body).

$ua = LWP::UserAgent->new; $ua->proxy(['http', 'ftp'] => 'http://user:pass@proxy.site'); $req = HTTP::Request->new('GET',"$link"); $res = $ua->request($req); $body = $res->content;

It is important to make sure that proxy.site is not the url that you entered in the tools options of the web browser as the proxy server, but is the one that comes up on the user/pass request box when you are entering those values manually when requested (that took me a while to figure out).

Thanks for pointing LWPcook out. There are a number of copies out there, but the only one complete one is on CPAN at http://search.cpan.org/~gaas/libwww-perl-5.808/lwpcook.pod

Chris Herold

In reply to Re^2: Accessing webpages with proxy url requiring user/pass by cdherold
in thread Accessing webpages with proxy url requiring user/pass by cdherold

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.