logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

mechanize and recorder end up with blank page: msg#00070

Subject: mechanize and recorder end up with blank page
hi all

i'm terribly sorry to bug you again with the same problem as a month ago. the 
thing is, i don't get it.

i'm trying to script a "add story" to a postnuke managed site.

after login all i get is a blank page. completelly empty, but with the correct 
URL. this happens with mechanize and with http:recorder via http::proxy, so i 
guess it's not my code that matters... i am probably missing a library or 
something right?

anyway, this is my procedure:


         $agent->get("http://www.kiberpipa.org/admin";);
        if ($agent->success) {
                print "logging into cyberpipe... \n";
        } else {
                &report_status("didn't get login screen");
                die "post failed:",$agent->response->status_line;       
        }
         $agent->form_number(1);
         $agent->field("pass", $cp_pass);
         $agent->field("uname", $cp_uname);
         $agent->field("url", "http://www.kiberpipa.org/admin/";);
         $agent->field("module", "NS-User");
         $agent->field("op", "login");
        $agent->click("prijava");

        if ($agent->success) {
                &report_status("uspe􏺹na prijava na ".$agent->uri);
        } else {
                &report_status("didn't login");
                die "post failed:",$agent->response->status_line;       
        }

# this seems allright

         $agent->get("http://www.kiberpipa.org/admin/";);
        if ($agent->success) {
                print "going to send story\n";        
        } else {
                &report_status("didn't get admin screen");
                die "post failed:",$agent->response->status_line;       
        }

         
$agent->get("http://www.kiberpipa.org/admin.php?module=NS-AddStory&op=main";);
        if ($agent->success) {
                print "sending story to ".$agent->uri()."\n";    
        } else {
                &report_status("didn't get upload screen");
                die "post failed:",$agent->response->status_line;       
        }

# prints "sending story to.. " and correct url, that is, 
http://www.kiberpipa.org/admin.php?module=NS-AddStory&op=main


         $agent->form_number(3);
         $agent->field("subject", $naslov);
         $agent->field("hometext", $besedilo);
         $agent->field("bodytext", $razsirjeno);
         $agent->field("op", "PostAdminStory");
         $agent->field("module", "NS-AddStory");

        if ($agent->success) {
                &report_status("$naslov uspe􏺹no dodan na ".$agent->uri);
        } else {
                &report_status("nisem uspel poslati zgodbe!");
                die "post failed:",$agent->response->status_line;       
        }

# returns: no form numbered 3, which is quite normal, because the page it gets 
is empty.





regards, bostjan




<Prev in Thread] Current Thread [Next in Thread>