[Chicago-talk] www::mechanize - setting a drop down list

Jay Strauss me at heyjay.com
Sun Nov 2 08:29:42 CST 2003


Thanks Ed, yep just that, I needed to click a radio button

----- Original Message -----
From: "Ed Summers" <ehs at pobox.com>
To: "Chicago.pm chatter" <chicago-talk at mail.pm.org>
Sent: Sunday, November 02, 2003 7:38 AM
Subject: Re: [Chicago-talk] www::mechanize - setting a drop down list


> On Sat, Nov 01, 2003 at 06:27:34PM -0600, Jay Strauss wrote:
> >   <SELECT NAME="TIME_PERIOD" onChange="selectTimePeriod()" SIZE="1"
> > STYLE="font-size: xx-small; font-family: Arial,Helvetica;">
> >       <OPTION VALUE="0" SELECTED>Last 7 Days</OPTION>
> >       <OPTION VALUE="1" >Last 14 Days</OPTION>
> >       <OPTION VALUE="2" >Last 30 Days</OPTION>
> >       <OPTION VALUE="3" >Last 60 Days</OPTION>
> >       <OPTION VALUE="4" >Last 6 Months</OPTION>
> >       <OPTION VALUE="5" >Current Year</OPTION>
> >       <OPTION VALUE="6" >Prior Year</OPTION>
> >   </SELECT>
>
> It looks like there is some JavaScript being called as a result of the
> onChange attribute on the SELECT tag. Most likely it is doing some
> sort of client side form verification before it submits the form.
>
> Last I heard there is some rudimentary support for JavaScript in
> WWW::Mechanize, but nothing that would handle this function
selectTimePeriod().
> You could look at the JavaScript code, figure out what it is doing, and
change
> your WWW::Mechanize bot behavior as appropriate. Perhaps it is mapping the
> value's to a new value, or doing some other kind of voodoo? If you post
the
> whole page I would be willing to take a look.
>
> A couple other things to double check:
>
> - is the form name really "DATERANGE"?
>
> - is there a special button that the user is supposed to click, like a
>   "search" button or something? If so, you'll have to specify the button
>   to click with the 'button' parameter in your call to submit_form().
>
> Good luck!
>
> //Ed
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
>




More information about the Chicago-talk mailing list