Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Confused about LWP, Mechanize and UserAgent

by tomfahle (Priest)
on Jun 07, 2006 at 19:47 UTC ( #554132=note: print w/replies, xml ) Need Help??


in reply to Confused about LWP, Mechanize and UserAgent

Hi, You can't do that with LWP::Simple. See http://search.cpan.org/~gaas/libwww-perl-5.805/lwptut.pod#HTTP_Authentication for a tutorial.
use strict; use LWP; my $browser = LWP::UserAgent->new; $browser->credentials( 'www.mydomain.com:80', # Look up this realm with your browser, eg. Firefox 'web_server_usage_reports', 'user_plinky' => 'Password_banjo123' ); my $url = 'http://www.mydomain.com/program.cgi?var1=apples&var2=bananas'; my $response = $browser->get($url); #......
Hope this helps

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://554132]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2021-10-26 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (90 votes). Check out past polls.

    Notices?