Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Syntactic Confectionery Delight
 
PerlMonks  

davidrw's scratchpad

by davidrw (Prior)
on Feb 02, 2005 at 03:25 UTC ( #427129=scratchpad: print w/ replies, xml ) Need Help??

use strict; use warnings; use WWW::Mechanize; use MIME::Base64; my $PW = 'PWPWPW'; my $auth = MIME::Base64::encode("" . ':' . $PW); my $mech = WWW::Mechanize->new(); #$mech->default_headers->authorization_basic("", $pw); $mech->add_header( 'Authorization' => 'Basic ' . $auth ); $mech->get('http://192.168.1.254/left1.htm'); print $mech->content; __END__ my $mech = WWW::Mechanize->new(); my @args = (Authorization => "Basic " . MIME::Base64::encode("" . ':' . $PW)); $mech->credentials('192.168.1.254:80', 'ABCDEF', "", $PW); $mech->get('http://192.168.1.254/', @args); print $mech->content; warn MIME::Base64::encode("" . ':' . $PW) . "-"; __END__ my $mech = WWW::Mechanize->new(); #$mech->default_headers->authorization_basic("", $pw); #$mech->add_header( 'Authorization' => 'Basic OmVsbHkwMA==' ); #$mech->get('http://192.168.1.254/left1.htm'); $mech->get('http://www.google.com'); print $mech->content;
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-04-17 03:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (439 votes), past polls