Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

How to close Firefox browser from perl script

by Anonymous Monk
on Jul 12, 2012 at 06:18 UTC ( [id://981303]=perlquestion: print w/replies, xml ) Need Help??

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

I am using WWW::Mechanize::Firefox module and doing some operations. In for loop every time I open some link and authenticate there and do some operations. Here problem I face is every time without clearing cache and cookies I could not get what I want. Browser clear the private data after its closed and then again I can open the browser in loop. This will full fill my requirement. Any pointers regarding this. You are welcome if there is any other approach which can solve the problem. Thanks

  • Comment on How to close Firefox browser from perl script

Replies are listed 'Best First'.
Re: How to close Firefox browser from perl script
by shrishinde (Initiate) on Jul 12, 2012 at 06:37 UTC

    Another problem is Mozrepl cant be started when browser is started, so closing and reopening the browser will not help me. Can any one please tell me how to clear the private data for Firefox browser using Perl.

      I recommend starting the mozrepl plugin at start.

      If you cannot use the corporate installed version of Firefox, have a look at the "Portable Firefox" versions. These are what I use for testing with various versions of Firefox.

Re: How to close Firefox browser from perl script
by pvaldes (Chaplain) on Jul 12, 2012 at 13:47 UTC

    Not sure that I'm understanding your problem, a little example could probably help.

    pick up the 'pid' of the firefox process (see i.e getppid), then:

     kill 9, $my_firefox_pid;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 06:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found