On Monday, June 10, 2002, at 06:30 PM, Geoffrey F. Green wrote:
> On 6/10/02 8:55 PM, "bob ackerman" <[EMAIL PROTECTED]> wrote: > >> # Fetch the page >> $admin = ARGV[0]; #password >> print $admin,"\n"; >> my $ua = LWP::UserAgent->new; >> my $req = HTTP::Request->new(GET => 'http://192.168.0.1/status.htm'); >> $req->authorization_basic('', $admin); #not working >> my $thePage = $ua->send_request($req); >> >> but it doesn't seem to authenticate. i have tried various usernames: >> 'root' >> , 'admin'. my logged in user name. >> doesn't help. > > Couple of things: > > 1) Are you sure the URI is correct? that's the problem. i don't know about the username. i login on the webpage at 192.168.0.1 but there is no user name involved. just the password which i am using. i do get a response, but not the status info: <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><SCRIPT LANGUAGE=JavaScript><!-- function GURL(x){var t=new Date(); location=x+'&ZT='+t.getTime();} function makesure(p,l){if (confirm(p)) GURL(l);} //--></SCRIPT></HEAD><BODY TEXT=#000000 BGCOLOR=#FFFFFF LINK=#006693 VLINK= #006693 ALINK=#006693><SCRIPT LANGUAGE=JavaScript><!-- parent.menu.reload(); //--></SCRIPT></BODY></HTML> the python code gets the info. > 2) When you log into the router administration page manually, using your > web > browser, do you have to enter a username or password? Those should be the > values that you should enter using the script. If you don't need a > username > or password, maybe the problem is that you're passing a password, and > that's > screwing it up somehow. no username, but i do need a password which i am using. and the python code seems to be sending a user name and password - although what the password is i can't grok. > 3) FYI, the script I posted -- which seems to be what you modelled yours > after -- assumes that you're getting at the router from behind the router. > Stupid point, yes, and I'm sure you already know that, but I've gotten > tripped up making enough moronic mistakes that I feel obliged to point > them > out. yes. i am behind the router. > - geoff > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]