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

Re: HTML::TreeBuilder scan for first table

by codiac (Beadle)
on Jan 24, 2016 at 22:59 UTC ( #1153524=note: print w/replies, xml ) Need Help??

in reply to HTML::TreeBuilder scan for first table

Did you read the POD for this method?

  @elements = $h->look_down( ...criteria... );
  $first_match = $h->look_down( ...criteria... );

This starts at $h and looks thru its element descendants (in pre-order), looking for elements matching the criteria you specify. In list context, returns all elements that match all the given criteria; in scalar context, returns the first such element (or undef, if nothing matched).
my $table = $h->look_down('_tag', 'table'); my @rows = $table->look_down(_tag => 'td', class => qr/HeaderTitle\b?/ +);

Replies are listed 'Best First'.
Re^2: HTML::TreeBuilder scan for first table
by mazdajai (Novice) on Jan 29, 2016 at 15:51 UTC
    Yup I did read the POD, I was trying to use one look_down method but obviously I cannot do that.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2023-10-03 14:34 GMT
Find Nodes?
    Voting Booth?

    No recent polls found