in reply to WWW::Mechanize::Chrome : gets stuck sometimes

Ah hah - it seems that loading the same URL twice (as the zoom.earth URLs are, except for the anchor), makes Chrome issue a Page.navigatedWithinDocument event instead of one of the other events. I'll have to find out how to handle those in a sane fashion, as all the network traffic then will be come from Javascript afterwards ...

Update A quick workaround is to navigate to a different page before fetching the next page:

... $mech->get('about:blank'); $mech->get($aurl); ...

I've managed to reproduce the situation outside this setup - any two URLs that are identical except for the fragment will trigger this problem.

Replies are listed 'Best First'.
Re^2: WWW::Mechanize::Chrome : gets stuck sometimes
by bliako (Abbot) on Aug 01, 2018 at 20:39 UTC

    excellent catch. I did indeed see a  Page.navigatedWithinDocument error being reported but forgot to mention it ... the heat.

    WWW::Mechanize::Chrome is at version 0.17, google-chrome is Version 68.0.3440.75 (Official Build) (64-bit) and it is run under linux fedora 27 latest kernels and all, perl is at v5.26.2.

    Unrelated: what is the proper way to shutdown the client and make sure that no "chrome" process is still running? And how do I reset cookies? Is there a WWW::Mechanize::Chrome forum where I can post these questions without pestering you here or shall I post another question?

    thanks, bliako

      https://perlmonks.org is the correct "forum" to use for support and bug reports. This should also be noted somewhere in the documentation.

      The interface for cookies is fairly rudimentary so far, but if you use a private Chrome instance with its own profile, you'll get a fresh/empty cookie jar every time.

      The proper way to shutdown your Chrome instance is to let the WWW::Mechanize::Chrome object go out of scope. That should clean up the Chrome process associated with it. But maintaining that is a constant battle against circular references.

        OK thanks.