How to use synchronize method with WWW::Mechanize::Firefox?
问题 I'm using WWW::Mechanize::Firefox and am trying to use the synchronize method like so: $mech->get('http://example.com/wp-login.php'); $mech->submit_form( with_fields => {log => 'admin', pwd => 'password'}); $self->synchronize( 'DOMContentLoaded', sub {print Dumper($self->title()); }); exit; The title of the newly loaded page prints but then the script just hangs. It never exits. What am I missing? 回答1: The subroutine that you pass to synchronize is meant to do something that kicks off an