in reply to How to use synchronize method with WWW::Mechanize::Firefox?

Oops on the typo. But even without the typo, I have the same issue.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

  • Comment on Re: How to use synchronize method with WWW::Mechanize::Firefox?

Replies are listed 'Best First'.
Re^2: How to use synchronize method with WWW::Mechanize::Firefox?
by Corion (Patriarch) on Mar 27, 2016 at 10:30 UTC

    So where does your callback perform an action, like clicking?

      OK, I reread your previous post. It has to click on a button? I will try that.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

      Tried:

      $self->synchronize( 'DOMContentLoaded', sub { $self->click_button( nam +e => 'wp-submit' ); } );

      I still get same results. The next page loads but then browser hangs.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

      Also tried $self->synchronize( 'DOMContentLoaded', sub { $self->click( {selector => '#wp-submit'} ); } );

      Same results.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

        Do you really need to use ->synchronize? This method is mostly useful if you want to do things that do not end up loading a new page.

      I've also tried the following:

      $self->synchronize( 'DOMContentLoaded', sub { $self->submit_form( with +_fields => {log => 'admin', pwd => 'password'} ) } );

      The submit_form gets called and the next page loads but then the script just hangs.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks