Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 exploiting the Monastery: (7)
As of 2014-10-25 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (138 votes), past polls