in reply to Re: Problem using MozRepl and MozRepl::RemoteObject
in thread Problem using MozRepl and MozRepl::RemoteObject

Thanks,
I first experimented WWW::Mechanize::Firefox.
My tests with simple examples usually work, but as soon as I try some more complicated tests, problems appear...
Is it because of javascript ?
Since I have decided to manipulate HTML with perl, I am still looking for the right solution...
That's why I thought using directly mozrepl to drive Firefox could be a better solution, minimizing the intermediaries between Perl and Firefox.
cf006

  • Comment on Re^2: Problem using MozRepl and MozRepl::RemoteObject

Replies are listed 'Best First'.
Re^3: Problem using MozRepl and MozRepl::RemoteObject
by Corion (Patriarch) on Nov 04, 2013 at 16:58 UTC

    I don't know what problems you experience. Maybe you can post a short, self-contained example that exhibits the problems?

    Personally, I use WWW::Mechanize::Firefox for lots of things without problems.

      Thanks Corion.
      I followed your advice and I again tried to do what I wanted with WWW :: Mechanize :: Firefox.
      Indeed, it is possible to do many things with this module.
      For example, I have automatically completed the username and password fields on a form to be authenticated on a site.
      It's true that it works pretty well.
      However, I encounter the same problem when using the MozRepl module, whith the following error message :
      "command timed-out at C:/Perl/site/lib/MozRepl/Client.pm line 186"
      First, il means that WWW::Mechanize::Firefox uses MozRepl.
      Then, I have to precise that this message isn't displayed every time I run the script.
      But, with some pages, it is displayed automatically.
      Moreover, in this case, a dialog box displays a message saying that the script https://path_to_script.js seems not to response and asks if you want to stop it.
      To resolve this problem, is there a way to change the value of this timeout ?
      Or, is it possible to avoid running this script, before the page is loaded ?
      Another problem, for pages with a lot of javascript, loading time is sometimes long. How can we improve this?
      cf006

        There is no convenient way to set the timeout of MozRepl::Client through WWW::Mechanize::Firefox. The least inconvenient way is to set $ENV{MOZREPL_TIMEOUT} before constructing your instance of WWW::Mechanize::Firefox, I guess. The more inconvenient way involves reaching down to

        $mech->repl->repl->client->{telnet}->timeout(60)

        This is not pretty, but should allow you to set the timeout.

        There is no convenient way with WWW::Mechanize::Firefox to block scripts from loading. Have you looked at an ad blocker?