Hello,
I seem to be going round in circles trying to understand the mechanize data structure, i've issued the following
And here is where I get stuck, I need to find the 'names' of the input fields as the page is that pesky .net and so creates a dynamic field name each time the page loads.
If I use this..
I get ...
But how do I get access to the hash and find out what the name/value pairs are?
If I try..
I get
I haven't a clue what that means or why it's erroring, can someone help with this please?
Thanks.
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
I seem to be going round in circles trying to understand the mechanize data structure, i've issued the following
Code:
my $mech = [URL unfurl="true"]WWW::Mechanize->new();[/URL]
$mech->agent_alias( 'Windows IE 6' );
$mech->get( $URL );
my @fields = $mech->find_all_inputs;
And here is where I get stuck, I need to find the 'names' of the input fields as the page is that pesky .net and so creates a dynamic field name each time the page loads.
If I use this..
Code:
foreach my $key (@fields){
print $key . "<br>";
}
HTML::Form::TextInput=HASH(0x31443cc)
HTML::Form::TextInput=HASH(0x31444b0)
HTML::Form::TextInput=HASH(0x31444a4)
HTML::Form::TextInput=HASH(0x3144630)
HTML::Form::TextInput=HASH(0x3144198)
HTML::Form::TextInput=HASH(0x3143fdc)
HTML::Form::TextInput=HASH(0x314457c)
But how do I get access to the hash and find out what the name/value pairs are?
If I try..
Code:
foreach my $key (@fields){
foreach my $kn( keys $key){
print $key->{$kn} . "<br>";
}
}
Type of arg 1 to keys must be hash (not private variable)
I haven't a clue what that means or why it's erroring, can someone help with this please?
Thanks.
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!