The problem is, that the program crashes if the link is not found or a link cannot be followed (e.g. an email address returns the error 'can't find sendmail' and exits). How can I prevent the program from crashing?use WWW:Mechanize $website=WWW::Mechanize->new(); $website->get('http://www.website.com'); $link_id=0; while(1) { $link_id++; if($website->follow_link(n=>$link_id)) { do_something(); $website->back(); } else { last; } }
In reply to WWW::Mechanize - Check if link can be followed by Microcebus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |