|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
conditional testing for error 500 webpages before following them?by fraizerangus (Sexton) |
| on Oct 15, 2011 at 13:09 UTC ( #931652=perlquestion: print w/ replies, xml ) | Need Help?? |
|
fraizerangus has asked for the
wisdom of the Perl Monks concerning the following question:
Hi Monks
The website I am trying to scrape from has some links which can't be followed because of a server issue, when I iterate through the links on the page the prgram crashes because of these 'down links'. What is the best way of testing these links first before I follow them and extract the URL? An example of teh doen link is as follows: http://www.molmovdb.org/cgi-bin/motion.cgi?ID=ppar Would I need Test::WWW::Mechanize to test before following? Also is it possible to iterate the get($url) in a loop for the links, everything I've tried so far does'nt allow me to do so, it wants an absolute URL? Using the following code:
many thanks and best wishes Dan
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||