Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Use Parsers To Get Chunk of HTML?

by merzy (Scribe)
on Jul 04, 2005 at 04:22 UTC ( #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? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2022-01-17 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?