use HTML::Element;
use HTML::TreeBuilder;
my $root = HTML::TreeBuilder->new;
$root->parse_file('foo.html'); # source file
foreach my $img ($root->find_by_tag_name('img')) {
my $alt = $img->attr('alt');
if(!$alt) {
my $bad_img = $img->attr('src');
print "There is no alt tag for the image $bad_img\n";
}
}
For more info, I would highly suggest reading Sean M. Burke's articles in The Perl Journal #18 and #19 located in the archives at tpj.com. In reply to Re: Scanning web pages for accessibility
by Steve_p
in thread Scanning web pages for accessibility
by Stegalex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |