a certain html element located by its nth order from the top/start of file
The CSS :nth-of-type() selector might be what you are looking for, which is supported by Mojo::DOM::CSS; try changing the 1 to a 2 in the following to see the effect:
use Mojo::DOM; my $dom = Mojo::DOM->new($html); $dom->at('nav:nth-of-type(1)')->remove; print $dom->to_string;
In reply to Re: How do we remove specific HTML tag
by haukex
in thread How do we remove specific HTML element
by abdan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |