Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Removing HTML beginning and ending tag with everything in between?

by ikegami (Patriarch)
on Sep 01, 2011 at 20:23 UTC ( [id://923716]=note: print w/replies, xml ) Need Help??


in reply to Removing HTML beginning and ending tag with everything in between?

For that very specific text, your substitution does work. (There's a syntax error building your string because you use " as a delimited and you didn't escape the " characters within the string.)

Using XML::LibXML (which has an HTML parser), it would be:

for my $node ($root->findnodes('//div[@id="print"]')) { $node->parentNode()->removeChild($node); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found