I am not sure how you come to the conclusion that you should have to append anything to the address of the page. My points 1. and 2. do not say anything about appending anything to any address of any page anywhere.
Since I am lazy, I will show you how I attack the problem using the method described first, the easy translation of the Javascript code to Perl.
Looking at the definition of the JavaScript __doPostBack routine, it mostly replaces ever $ by a : and then sets the fields __EVENTTARGET and __EVENTARGUMENT in the form to the passed values. So, to simulate a "click" on one of the region selections, one would have to set these fields correctly, too.
use strict;
use WWW::Mechanize;
my $agent = WWW::Mechanize->new( autocheck => 1 );
sub __doPostBack {
my ($eventTarget,$eventArgument) = @_;
$agent->current_form->field('__EVENTTARGET',$eventTarget);
$agent->current_form->field('__EVENTARGUMENT',$eventArgument);
};
# ... load the page, and select the various zones
I will not write the whole script for you. You now have to look through the input fields on $agent->current_form and look which zones are suitable for you and loop over these. You should understand how JavaScript works and how to analyze the code. |