-- Romanuse HTML::TreeBuilder; use Data::Dump qw{dump}; my $tree = HTML::TreeBuilder->new_from_file("your_html_file"); my %output = (); for my $div ($tree->find("div")) { if(my $titlefield = $div->look_down(class => "titlefield")) { my $href = $titlefield->attr("href"); $output{$href} = [$titlefield->attr("title")]; my $date = ""; if(my $datefield = $div->look_down(class => "datefield")) { $date = $datefield->as_text(); } push @{$output{$href}}, $date; # ... } } dump { %output };
In reply to Re: HTML Parsing /Regex Qstn
by bobr
in thread HTML Parsing /Regex Qstn
by sri1230
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |