Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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:

Hi,

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.

    Regards,

    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.

      Update

      https://github.com/bard/mozrepl

      > 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2020-07-06 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?