http://www.perlmonks.org?node_id=472125


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