in reply to Re: Re: Re: Follow through POST method
in thread Follow through POST method

Thanks for the prompt reply!!
But things here may be simple for you, not for me. Not Complaining. I very much appreciate your help.

The three regions in the code are actually three radio buttons. If either one is clicked it takes me to a new page. So how do i choose and click the radio button. The process for clicking a button is agent->click(); but what about the radio button. I read the www::mechanize page, but it is still not very clear to me.

The code for the radio buttons is

<table id="rdlZone" class="RBtnList" cellspacing="1" cellpadding="1" b +order="0"> <tr> <input id="rdlZone_0" type="radio" name="rdlZone" value="1" onclic +k="__doPostBack('rdlZone_0','')" language="javascript" /><label for=" +rdlZone_0">Chennai Madras</label> </tr> <tr> <td><input id="rdlZone_1" type="radio" name="rdlZone" value="2" on +click="__doPostBack('rdlZone_1','')" language="javascript" /><label f +or="rdlZone_1"></td>US Embassy New Delhi</label></td> </tr> <tr> <td><input id="rdlZone_2" type="radio" name="rdlZone" value="3" on +click="__doPostBack('rdlZone_2','')" language="javascript" /><label f +or="rdlZone_2"></td>Calcutta (Kolkata)</label></td> </tr> </table>

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Follow through POST method
by Corion (Patriarch) on May 06, 2004 at 06:31 UTC

    Once again. You need to understand JavaScript, and how it interacts with the browser. First, visit the site you want to automate with JavaScript switched off. If the site works, then use the pages without JavaScript. Otherwise, you need to parse the HTML with HTML::Parser or get at the radio elements through the interface of HTML::Form, and then use the values of these elements together with the code I already outlined.

    Automating JavaScript-polluted pages is not easy, and you need to understand what the page exactly does before you can automate it.