Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Tab closing Mechanize::Firefox

by PerlSufi (Friar)
on Jul 12, 2013 at 17:46 UTC ( [id://1044037]=perlquestion: print w/replies, xml ) Need Help??

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

Hello Monks,
I have successfully created a crawler with WWW::Mechanize::Firefox that downloads a file that I need. My problem is that I am having trouble autoclosing the tab.
my $mech = WWW::Mechanize::Firefox->new(launch => 'C:\Program Files (x +86)\Mozilla Firefox\firefox.exe', autoclose => 1, autodie => 1);
It seems to auto close when I sign out of my account, but not automatically when the script is done- even if I have 'exit;' at the end. Do I need to do this separately with the Firefox::Application module?

Replies are listed 'Best First'.
Re: Tab closing Mechanize::Firefox
by ww (Archbishop) on Jul 12, 2013 at 22:48 UTC
    Have you read the docs? Have you searched this site? ...the www? Have you tried to help yourself?

    This is a "gimme" post -- give me the answer so I don't have to hunt it up. That's a big -   - in my book... especially since you've been counseled about this before.

    If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.
      Hi ww,
      I did not intend on this being a 'gimme' post, sorry if it seemed that way. I have read the documentation and implemented it in a way that I understood to be the correct method. I will investigate it further, thank you for your consideration
        For those who wonder how to do it in the future, I implemented something similar to the following method:
        my $site_tab = "my site"; my $ff = Firefox::Application->new(); $mech->get('https://mysite.com'); $ff->closeTab($site_tab);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-23 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found