#!/usr/bin/perl -w use strict; use HTTP::Lite; use HTML::TreeBuilder; my $http = new HTTP::Lite; my $req = $http->request("http://has.ncdc.noaa.gov/pls/plhas/has.dsselect") or die "Unable to get document: $!"; die "Request failed ($req): ".$http->status_message() if $req ne "200"; my $body = $http->body(); my $t = HTML::TreeBuilder->new_from_content($body) or die qq{cant build tree: $!\n}; my @anchors = $t->look_down(_tag => q{a}); for my $anchor (@anchors){ if ($anchor->as_text eq q{NEXRAD Level III}){ $anchor->replace_with_content; } } print $t->as_HTML( undef, q{ }, {}, ); $t->delete;