Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Extract Portion of HTML

by Tux (Canon)
on Sep 19, 2011 at 11:35 UTC ( [id://926720]=note: print w/replies, xml ) Need Help??


in reply to Extract Portion of HTML

use HTML::TreeBuilder; my $tree = HTML::TreeBuilder->new; $tree->parse_content ($html_text); foreach my $d ($tree->look_down (_tag => "div", class => "myBody")) { # $d is the div node. Use whatever you like with/on it $d->as_text =~ m/something/ and $d->delete; # To remove it. } $html_text = $tree->as_HTML (undef, " ", {});

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found