develooper Front page | perl.beginners | Postings from February 2009

Test::HTTPStatus

Thread Next
From:
Ganesh Babu N
Date:
February 19, 2009 21:01
Subject:
Test::HTTPStatus
Message ID:
c075eed70902192101sdcc9e6dgd7e1a0d3deba2e31@mail.gmail.com
Dear All,

I am testing the weblinks for connectivity using Test::HTTPStatus
module. I could able to test 187 and in those 165 links are success
and 22 links are failed. When I test manually by entering the weblink
in the browser out of 22, 5 weblinks are working fine.

I am not sure why this module is showing those 5 links as failure. Can
somebody help in get it resolved.

My code is as follows:

unlink("linktest.log");
$xfile = "$ARGV[0]";
open(OUT, ">>linktest.log");
use XML::XPath;
use XML::XPath::XMLParser;
use Test::HTTPStatus tests=>1;
$xp = XML::XPath->new(filename => $xfile);
$nodeset1 = $xp->find('//xref/@href');
foreach $node1 ($nodeset1->get_nodelist) {
	$aid=XML::XPath::XMLParser::as_string($node1);
	$aid=~s!href="!!g;
	$aid=~s!"!!g;
	$aid=~s! !!g;
    $a=http_ok( $aid, HTTP_OK );
	sleep 10;
	print OUT "$aid\n" if ($a == 0);
	}	
	
close(OUT);

Regards,
Ganesh

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About