On Tuesday, June 11, 2002, at 10:55 PM, Todd Wade wrote: > Right, but is the document you are trying to get the ip from called > status.htm?
i have changed my strategy since then. the python posted to the /cgi- bin/logi file first to login. then called the status.htm to get data. again, i say, it works in python. so i am trying to do the POST to login first, and it is failing. i'm pretty sure i can get the data if i can login successfully. > In another of your posts, you put: > > params = urllib.urlencode({'RC': '@D','ACCT' : "root",'PSWD' : > "71:29:26",'URL': 'admin'}) > ipurl = "http://" + iphost + "/cgi-bin/logi" > urlfp = urllib.urlopen(ipurl, params) > > which looks like to me you are getting the ip address out of a document > called: > > http://192.168.0.1/cgi-bin/logi > no. that is the login file i am now trying to POST to: use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = HTTP::Request->new(POST => 'http://192.168.0.1/cgi-bin/logi', HTTP::Headers->new(), [RC => '@D', ACCT => 'root', PSWD => '71:29:26', URL =>'admin']); $r = $ua->request($req); $r->is_success() ? print $r->content(),"\n" : print "Failed to login\n"; this is what is failing. when i try this POST from the shell command line, i get: echo 'RC=@D&ACCT="root"&PSWD="71:29:26"&URL="admin"' | POST -u -U -s -S -e -x 'http://192.168.0.1/cgi-bin/logi' LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: POST http://192.168.0.1/cgi-bin/logi LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () admin LWP::UserAgent::request: Simple response: Internal Server Error POST http://192.168.0.1/cgi-bin/logi User-Agent: lwp-request/2.01 Content-Length: 46 Content-Type: application/x-www-form-urlencoded POST http://192.168.0.1/cgi-bin/logi --> 500 EOF instead of reponse status line > Todd W. rda