> Could you provide a complete demo of the problem?  Perhaps with a
> minimized example of the HTML you have problems with.
> 
> Regards,
> Gisle
> 


Sure . Here is the snippet I have been having problem with : ($local_url will
have the following value after I extract the links in the main page using
LinkExtor. As you can see, infact the stnid parameters is already being
passed in as part of the URL string , but when I list the current values of
the fields 'stnid' fields shows the default, which is "Please select a
station", and it doesn't have the Port Chicago station as selected earlier!!)

If you point the browser to the following $local_url, what you will see is 
the page that already shows the station selected..

  $local_url =
'http://www.co-ops.nos.noaa.gov/cgi-bin/plotqry.cgi?stnid=9415144+Port+Chicago,+CA&flag=1'

   ...
  $res = $ua->request(HTTP::Request->new(GET => $local_url ) ); 
  if ( $res->is_success ) 
   {
     #print $res->content; 

     my @forms = HTML::Form->parse($res->content,$res->base); 
     my $form; 

     foreach (@forms) 
     {
      $form = $_; 
      if ($_->action =~ /get_plot.cgi/) 
      {
       print " Found form that contains the action script!\n"; 
      last; 
      }
     }

     if ($form){
      print "Form Obtained : \n"; 
      print $form->form; 

      $form->value('Action','Wind'); 
      $form->value('stnid',"9415144 Port Chicago, CA");  # HERE is the error
      #&ListInputs($form); 
      my $req = $form->click; 
      $res = $ua->request($req); 

      if ($res->is_success) 
      {
       print "Successful click..!\n"; 
       print $res->content; 
      }

     }

 
-------

Now, when I don't attempt to change the value of the 'stnid' field, and leave
it as it was , and lick the form. I get an HTML output saying there is not
plot available :

"
Sorry...there is no Wind Plot for today available at this time for
<br>Please select a station</h3>
"

See that the plot server script did not receive the  "Port Chicago" station,
and got the unselected option whose value stays at "Please select a station" 


thank you,

Cenk

Reply via email to