I am trying to parse an HTML file through my perl script. I am using a module called HTML::TreeBuilder.
Here is what I have so far:
use HTML::TreeBuilder;
my $tree = HTML::TreeBuilder->new;
$tree->parse_file("sample.html");
foreach my $anchor ($tree->find("p")) {
print $anchor->as_text, "\n";
}
It is working fine. I am getting everything inside < p> tag.
sample.html file:
< td>Release Version:< /td>< td> 5134< /td>< /tr>
< tr class="d0">< td>Executed By:< /td>< td>spoddar< /td>< /tr>
< tr class="d1">< td> Duration:< /td>< td>0 Hrs 0 Mins 0 Secs < /td>< /tr>
< tr class="d0">< td>#TCs Executed:< /td>< td>1< /td>< /tr>
I want 5134 to be printed when i pass Release Version.
In the same way I want spoddar to be printed when i pass Execute By.
These are not HTML tags. But is there any way to obtain this?
0 Hrs 0 Mins 0 Secsalso?