1 2 3 4 5 6 7 8
use WWW::Mechanize::Firefox; my $mech = WWW::Mechanize::Firefox->new(); $mech->get('http://perl-community.de/bat/poard/board/10'); $quellcode = $mech-> content(); if ($quellcode =~(m/firefox/)){ print "thread mit content = firefox gefunden"; } else{ system ("perl script.pl --processes=2") die; }
Quote$mech->new( %args )
use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();
Creates a new instance and connects it to Firefox.
Note that Firefox must have the mozrepl extension installed and enabled.
The following options are recognized:
tab - regex for the title of the tab to reuse. If no matching tab is found, the constructor dies.
If you pass in the string current, the currently active tab will be used instead.
my $mech = WWW::Mechanize::Firefox->new( tab => 'current');