my $dom = Mojo::DOM->new( $html ); $dom->find( $tag )->each( sub { $_-> remove } ); return $dom;