That is some strange filename
#!/usr/bin/perl -- use strict; use warnings; use HTML::TreeBuilder::XPath; my $tree= HTML::TreeBuilder::XPath->new_from_content(<<'HTML'); <body> <div class="Row May-2015"> <div class="Cell month-year even"> May-2015 </div> <div class="Cell Release Date even"> 2015-06-25 </div> <div class="Cell National Mortgage Contract Rate even" +> 3.750 </div> </div> HTML $tree->dump; my @rows = $tree->findnodes(q{//div[@class =~ /Row/ ]}); print 0+@rows, "\n"; for my $row ( @rows ){ my @cells = $row->findnodes(q{ //div[ @class =~ /Cell/ ] }); print 0+@cells, "\n"; for my $cell ( @cells ){ print $cell->as_trimmed_text, "\n"; } } __END__ <html> @0 (IMPLICIT) <head> @0.0 (IMPLICIT) <body> @0.1 <div class="Row May-2015"> @0.1.0 <div class="Cell month-year even"> @0.1.0.0 " May-2015 " <div class="Cell Release Date even"> @0.1.0.1 " 2015-06-25 " <div class="Cell National Mortgage Contract Rate even"> @0.1.0.2 " 3.750 " 1 3 May-2015 2015-06-25 3.750
In reply to Re^5: Nested div tag
by Anonymous Monk
in thread Nested div tag
by perlmad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |