jjap has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to get the hang of some automation with WWW::Mechanize::Firefox and can get as far as entering data in a form in what I think is a very simple case.
I tried various ways to activate/click/submit the "DECODE" button found on the page but to no avail. Here is my latest effort.Any hints would be appreciated.use strict; use WWW::Mechanize::Firefox; my $url = "http://www.decodethis.com"; my $agent = WWW::Mechanize::Firefox->new( activate => 1, autoclose => 0, ); my $sn = "1D7HU18D14J230995"; $agent->get($url); if ( $agent->success() ) { sleep(2); print "Retrieved $url\n"; $agent->form_name('Form'); $agent->field( 'dnn$ctr373$VINBox$tbVIN' => $sn ); sleep(2); $agent->submit_form( form => $agent->current_form()); }
Best regards!
Update: Corion's suggestion (click instead of submit_form) does the trick.Also good references suggested by Anonymous to learn on CSS selectors for those, like me, not that familiar with these ways.
Thanks to all.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Elusive button WWW::Mechanize::Firefox
by Corion (Patriarch) on Aug 11, 2012 at 06:48 UTC | |
by jjap (Monk) on Aug 11, 2012 at 13:22 UTC | |
by Corion (Patriarch) on Aug 11, 2012 at 13:41 UTC | |
by Anonymous Monk on Aug 11, 2012 at 13:47 UTC |