Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Use Parsers To Get Chunk of HTML?

by merzy (Scribe)
on Jul 04, 2005 at 04:22 UTC ( [id://472125]=note: print w/replies, xml ) Need Help??


in reply to Use Parsers To Get Chunk of HTML?

I've become a big fan of HTML::TreeBuilder for this sort of thing. If I understand your question, you'd do something like:
use HTML::TreeBuilder; my $tree = HTML::TreeBuilder->new_from_content($whole_thing); $tree->elementify(); my $good_chunk = $tree->look_down("_tag","div","id","good_chunk"); my $links_ref = $good_chunk->extract_links; my $good_chunk_html = $good_chunk->as_HTML;

Replies are listed 'Best First'.
Re^2: Use Parsers To Get Chunk of HTML?
by Cody Pendant (Prior) on Jul 04, 2005 at 04:33 UTC
    Wow, that worked straight away! Brilliant stuff. Thank you.


    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-24 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found