Actually, Win32::IE::Mechanize does do the polling.
After it calls the click() method on the input object, it calls an internal method called _wait_while_busy, which looks like this:
sub _wait_while_busy { my $self = shift; my $agent = $self->{agent}; # The documentation isn't clear on this. # The DocumentComplete event roughly says: # the event gets fired (for each frame) after ReadyState == 4 # we might need to check if the first one has frames # and do some more checking. my $sleep = 4; # 0.4; # while ( $agent->{Busy} == 1 ) { $sleep and sleep( $sleep ) } # return unless $agent->{ReadyState}; while ( $agent->{ReadyState} <= 2 ) { $sleep and sleep( $sleep ); } $self->{ $_ } = undef for qw( forms cur_form links images ); return $self->success; }
It looks like the author tried polling the Busy property, but that didn't work, and is trying the ReadyState property instead. That seems to work when the preceding call is $agent->navigate() (in Win32::IE::Mechanise::get()), but at least on my system it's breaking when the preceding call is $input->click().
But thanks for the link to the MSDN docs; I'll have a look and see what I can find out.
In reply to Re^2: Getting Win32::IE::Mechanize to wait for responses
by mickey
in thread Getting Win32::IE::Mechanize to wait for responses
by mickey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |