in reply to Re^4: How to use synchronize method with WWW::Mechanize::Firefox?
in thread How to use synchronize method with WWW::Mechanize::Firefox?

I'm not wedded to synchronize. I just want to find a more reliable way than sleep(2) and a less ridiculous way than sleep(30) to wait around for the page to load after a login attempt.

Ultimately, I'm trying to figure out if the login was successful. WordPress just offers up a 200 success code whether login is successful or not so I need to look at the contents of the page to determine if the login worked.

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

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

    Maybe looking at the actual HTTP traffic shows you whether the thing detemining the login happens later, maybe through Javascript.

    I did not find a convenient way to list all events as they happen during page load. Maybe you're looking at the wrong Javascript event. In my experiments, I found DOMContentLoaded to be quite reliable, but maybe in your case load is more reliable.

      Yeah, I tried load already. Didn't make a difference.

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