Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

automate firefox?

by morgon (Priest)
on Nov 23, 2019 at 23:16 UTC ( #11109127=perlquestion: print w/replies, xml ) Need Help??

morgon has asked for the wisdom of the Perl Monks concerning the following question:


browser-technology is evolving all the time and stuff you could do in the past no longer works (probably for very good reasons).

What I would like to do now is to find a way to remote-control firefox via a script.

In my ideal world I would write such a script (instructing firefox to enter this string in this input-field, press that button etc), bind that script to a key-combination in my windows-manager and live happily ever after - but I don't know how to to it...

WWW::Mechanize::Firefox I believe no longer works, Firefox::Marionette seems to work but only with a new instance and so on...

So my question:

Is there any combination of perl-modules and Firefox-extensions that would allow one to to remote-control a running firefox-instance via a script?

Many thanks!

Replies are listed 'Best First'.
Re: automate firefox?
by davies (Prior) on Nov 23, 2019 at 23:27 UTC

    You can get into version hell with the browser, driver and operating system, but Selenium will do most things. Disclaimer: see New Perl Selenium ebook.


    John Davies

Re:automate firefox? (WWW::Mechanize::Firefox no longer working)
by Anonymous Monk on Nov 23, 2019 at 23:51 UTC
      > WWW::Mechanize::Firefox doesn't work

      Yes and no.

      It depends on an FF add-on called MozRepl.

      But newer versions of FF deactivated the API used by MozRepl.

      So it'll still work with a FF older than v55.


      > Key technologies upon which MozRepl depends will be retired from the Mozilla platform in November 2017. If you are relying on MozRepl, please investigate migration paths. The last known compatible version is Firefox 54.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11109127]
Approved by davies
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2023-04-02 09:25 GMT
Find Nodes?
    Voting Booth?

    No recent polls found