Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How do we remove specific HTML tag

by haukex (Bishop)
on Nov 07, 2021 at 05:35 UTC ( #11138538=note: print w/replies, xml ) Need Help??


in reply to How do we remove specific HTML element

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138538]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2022-01-24 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?