Dynamic Forms, Javascript (what else!) and WWW::Mechanize

Peter Stevens <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
Hi everyone,

[ Apologies is this is the repeat of a topic which has been addressed 
earlier, but I couldn't find it ]

I am trying to use $mech to log in to www.sprint.com. This site was 
recently merged with the Nextel site, so the site now presents a Form 
asking you which service you want to log into. A javascript is executed 
and depending on your selection it displays a series of fields which 
allow you to log into that site.

Thanks to using Tamper Data, I know which variables I need to post. The 
problem is that when the page is first displayed (i.e. before the 
javascript [doesn't] execute, these form variables don't exist. They are 
apparently created by the javascript. So when I try

    $mech->field('min', $telno ) ;

I get an error from HTML::Form:

    No such field 'min' at
    /home/mmtest/local/lib/perl5/site_perl/5.8.5/WWW/Mechanize.pm line 1030
     at /home/mmtest/local/lib/perl5/site_perl/5.8.5/HTML/Form.pm line 402

So it looks like I just need to convince HTML::Form to create some new 
fields, but I couldn't find how to do this. Can anybody explain? Is 
there are better way to address this problem?

Thanks in advance!

Peter

----------------------------------------------------------------------
Peter Stevens
Get you Cell Phone costs under control!          www.MinuteWatcher.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.