in reply to Re: Mechanize Problems
in thread Mechanize Problems

Thank you. I tried Mech::Shell. A very nice tool. But unfortunately it generates the code I wrote (a bit different of course) with the same problem. Well never ind I have to accept that the site I want to reach must have a subtil bug.

Replies are listed 'Best First'.
Re^3: Mechanize Problems
by planetscape (Chancellor) on Dec 14, 2005 at 20:17 UTC

    Some experimentation with HTTP::Recorder suggests that what you want in place of $mech->click_button(value => "Fold it"); is instead: $mech->click('Action'); :

    $agent->get('http://rna.tbi.univie.ac.at/cgi-bin/RNAfold.cgi'); $agent->form_number(1); $agent->tick('toggles', '-noLP'); $agent->field('name', 'fakename'); $agent->tick('SVG', 'on'); $agent->field('email', name@domain.com'); $agent->field('Temp', '37'); $agent->tick('plot', 'on'); $agent->field('Params', 'RNA'); $agent->field('Sequence', 'GATTACAGATTACAGATTACA'); $agent->field('pffold', 'pf'); $agent->click('Action');

    (HTTP::Recorder records scripts using "$agent" instead of "$mech".)

    Viewing the HTML source of the page in question would have revealed your error:

    <input type="hidden" name="rec-form1-submit-Action" value=1> <input type="submit" name="Action" value="Fold it"> ^^^^^^

    HTH,

    planetscape