looks too complicated and not nice (but working).my $tmpi = 0; $fimg = $dom ->find('img, h1') ->map( sub { if( $_->tag eq 'h1' ) { $tmpi++; } if( $tmpi > 0 && defined $_->attr->{'src'} ) { $_->attr->{'src'} } # without semicolumn!!!! } ); for( my $ii = 0; $ii <= $#$fimg; $ii++ ) { if( length( $fimg->[$ii] ) > 0 ) { print $fimg->[$ii]; } }
In reply to Re^2: Mojo::DOM find tag after another tag
by luxs
in thread Mojo::DOM find tag after another tag
by luxs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |