in reply to How to use regex in Tree->look_down

my @rows = $tree->look_down (style => '128px', width => '160px');

True laziness is hard work

Replies are listed 'Best First'.
Re^2: How to use regex in Tree->look_down
by Anonymous Monk on Oct 24, 2009 at 09:29 UTC
    look_down works on html attributes, width is a css attribute
    #!/usr/bin/perl -- use strict; use warnings; use HTML::TreeBuilder; my $html = '<html><body> <span style="height:128px;width:160px">bob</span> </body></html>'; my $tree = HTML::TreeBuilder->new(); $tree->parse( $html ); print $tree->look_down('style',qr/\Q128px;width:160px\E/i)->dump; __END__ <span style="height:128px;width:160px"> @0.1.0 "bob"