use strict; use warnings; use HTML::TreeBuilder; my $p = HTML::TreeBuilder->new; my @content = ; $p->parse_content(@content); for my $match ($p->look_down('_tag' => 'div', 'class' => 'subsection')) { my $prop = $match->look_down ('class', 'box_profile_info_small_heading'); my $value = $match->look_down ('class', 'box_profile_info_small_content'); next unless $prop && $value; print $prop->as_text (), ' => ', $value->as_text (), "\n"; }