Click to See Complete Forum and Search --> : access hidden form value with Mech - Mechanize with Perl


crmpicco
04-12-2007, 12:06 PM
Anyone have any idea what the 28220 is at the end of this string?

07041216598.85.189.67.113.28220

The value is pre-populated in the script found at: http://booking.jet2.com/cgi-bin/airkiosk/I7/181002i?LS=6&LANG=EN&REF=


<input type=hidden name=AG id="AG" value='07041216598.85.189.67.113.28220'>


Does anyone know how I can access this value with Perl using Mechanize (Mech)?

Picco

phwaap
04-15-2007, 12:19 PM
my $m = WWW::Mechanize->new;
$m->get('http://booking.jet2.com/cgi-bin/airkiosk/I7/181002i?LS=6&LANG=EN&REF=');
my $f = $m->form_name('jet2booking');
my $v = $f->value('AGENT');
$v =~ s/^(.+)\.\d+$/$1.new/;
$f->value(AGENT => $v);
$f->dump;