gsiglet has asked for the wisdom of the Perl Monks concerning the following question:
Thank youuse HTML::TreeBuilder::XPath; # Parse html my $tree = HTML::TreeBuilder::XPath->new; my $parsed = $tree->parse_content( $some_html ); # Find some node my $nodeset = $parsed->findnodes('//iframe'); for my $node (@$nodeset) { #### Would something like that be possible somehow? ### $tree->replace_by($node, $some_other_node); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replace html nodes (HTML::Element treebuilder xpath)
by Anonymous Monk on Sep 03, 2013 at 10:48 UTC | |
by gsiglet (Acolyte) on Sep 03, 2013 at 11:51 UTC | |
|
Re: Replace html nodes
by daxim (Curate) on Sep 03, 2013 at 10:50 UTC |