it appears that i have a possible mechanize issue..

i'm parsing the gatech class schedule section. my code has the form for the
classes setup, and i can access the 1st dept in the select/option list.
however, when i try to get any of the subsequent list items, mechanize
responds with an error:

    Illegal value 'BIOL' for field 'sel_subj' at
/usr/lib/perl5/site_perl/5.8.0/WWW/Mechanize.pm line 467

This seems to occur regardless of what value I insert for the field. The
weird thing is that it works for the 1st item ("ACCT") in the list...

The following segment of code is what i'm using to setup the form....

   # go ahead and get the selection page within the frame..
   # use www::machanize
   #my $agent = WWW::Mechanize->new();

   $agent->get($url);
print "url = $url\n";
   my $_form = $agent->form_number(2);
   if (!$_form) {
       warn "Nothing came back";
       exit;
   }

   my $tmp;
   $agent->field("sel_subj", "dummy", 1);
   $agent->field("sel_day", "dummy");
   $agent->field("sel_schd", "dummy");
   $agent->field("sel_insm", "dummy");
   $agent->field("sel_camp", "dummy");
   $agent->field("sel_levl", "dummy");
   $agent->field("sel_sess", "dummy");
   $agent->field("sel_instr", "dummy");
   $agent->field("sel_ptrm", "dummy");
   $agent->field("sel_attr", "dummy");
   $agent->field("sel_crse", "");
   $agent->field("sel_title", "");
   $agent->field("sel_from_cred", "");
   $agent->field("sel_to_cred", "");
   $agent->field("sel_instr", "%");
   $agent->field("begin_hh", "0");
   $agent->field("begin_mi", "0");
   $agent->field("begin_ap", "a");
   $agent->field("end_hh", "0");
   $agent->field("end_mi", "0");
   $agent->field("end_ap", "a");
   $agent->field("sel_day", "");
   #$agent->field("sel_subj", $subject, 2);
   $agent->field("sel_subj", "BIOL", 2);

   my $res1 = $agent->submit();

   print "-- ".$agent->content(). "\n";

   my $url2 = $agent->response()->request()->content();

   #
   # go ahead and return the complete "post" url
   #
   #return($url2);
   my $q1 = $agent->uri()."?".$url2;
print "url = $q1\n";


a sample of the form select/option list follows...

<SELECT NAME="sel_subj" SIZE="3" MULTIPLE ID="subj_id">
<OPTION VALUE="ACCT">Accounting
<OPTION VALUE="AE">Aerospace Engineering
<OPTION VALUE="AS">Air Force Aerospace Studies
<OPTION VALUE="APPH">Applied Physiology
<OPTION VALUE="ARCH">Architecture
<OPTION VALUE="BIOL">Biology
<OPTION VALUE="BMED">Biomedical Engineering

is this a possible error/issue given how the site functions.. is it a
possible issue/error with mechanize... (i somehow doubt that it is, as i've
used mechanize with other sites with no probs...) i tried to do a download
from CPAN to see if there is a newer version of Mechanize, but it appears
that I have the latest version... although i might not..

any ideas/comments/possible solns...

thanks

-bruce


Reply via email to