my @anchors = $t->look_down(_tag => q{a}); my @hrefs; for my $anchor (@anchors){ if ($anchor->as_text eq q{NEXRAD Level III}){ push @hrefs, $anchor->attr(q{href}); $anchor->replace_with_content; } } print qq{$_\n} for @hrefs; #### HAS.FileAppSelect?datasetname=7000 #### $anchor->replace_with_content;