My mechanize script then goes and grabs the webpage:<html> <form> <button type="submit" id="test" name="test">My Button</button> </form> </html>
Mechanize then gives an error 'no clickable input with name test'. Dumper shows the form was located correctly, but that it contained no items.use WWW::Mechanize; use Data::Dumper; # URL to retrieve $url = 'http://myurl.html '; # Create an instance of Mechanize to scrape my $mechanize= WWW::Mechanize->new( autocheck => 1 ); # Grab the form $mechanize->get($url); $mechanize->form_number('1'); ($output) = $mechanize->current_form(); open(FH, '>dump.txt'); print FH Dumper($output); close(FH); $mechanize->click_button(name => 'test');
However, if I modify that original HTML code snippet to say <input type="submit></input> rather than <button>, Mechanize will successfully run the click_button() routine and Dumper shows that the form contained an HTML::Form::SubmitInput object.
How can I click on buttons then that are of the form <button type="submit"> or even find those buttons on the page? From the dump, it seems like Mechanize ignores them all together. Am I mistaking the functionality of click_button()? Click() may work for a single case, but when there are multiple buttons on a page, I need click_button().
Any help is appreciated.
-- RembrantXVII
In reply to WWW::Mechanize click_button by rembrantxvii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |