#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    12
    Rep Power
    0

    Need help with buttons


    It's an easy question but I'm totaly new to perl so i need some help .
    my $formfiller = WWW::Mechanize::FormFiller->new();

    $agent->env_proxy();

    $agent->get('URL');

    $agent->form_number(1) if $agent->forms and scalar @{$agent->forms};

    $agent->form_number(1);

    { local $^W; $agent->current_form->value('name', 'value'); };

    $agent->submit();

    I use the script like that to form fill .. but the problem at submit button because there is too many submit buttons and the submit button isn't the first one so script choose another button. here is the HTML of my button

    <input id="gtSubmitButton" class="gtButton" type="submit" value=" Submit D ">

    Can anyone help me?
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    335
    Rep Power
    247
    Mechanize has a method for specifically choosing which form is submitted...

    http://search.cpan.org/~jesse/WWW-Me...it_form(_..._)
    Free MP3 Dance Music Downloads

    To err is human; To really balls things up you need Microsoft!

IMN logo majestic logo threadwatch logo seochat tools logo