Perl WWW::Mechanize and Dynamic Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Edward Drake
    New Member
    • Jul 2007
    • 1

    Perl WWW::Mechanize and Dynamic Forms

    I'm trying to interact with a web page that uses JavaScript to add fields to a form if certain things are selected in the first field.

    I've tried doing something like this...

    $mech->get($someurl );
    $mech->field('field1' ,'selection2');
    $mech->field('created _field','data') ;
    $mech->click('submit' )

    This doesn't work because created_field doesn't exist until the javascript runs so Mechanize doesn't know about the field because when

    So my question, is there a way to add a field to a form after getting the page? I know what the field I need is and I really don't need the javascript to run (I understand that Mechanize can't run javascript anyway.) I just need to be able to manually add in the field. Any help with how to do this would be greatly appreciated.
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    I would think you can add in the form field manually, but I can only suggest you read the WWW::Mechanize documentation or wait and see if someone knows how to do this.

    Comment

    Working...