I have the following code to access a HTML table.
my $table = $tree->look_down(_tag => "table", id => "moduleDetail");
however the text is coming down not formatted, because the web page uses the tables borders to divide certain pieces of text. So its coming down something like this, "mathematics for computingJordanstown" with jordanstown being I assume in the next cell. here is the code that i am using,
my @array;
my $tree = HTML::TreeBuilder->new_from_content($mech->content);
my $table = $tree->look_down(_tag => "table", id => "moduleDetail");
for ($table ->look_down(_tag => 'tr')) {
push(@array,$_->as_text());
}
foreach(@array){
print $_, " ";
}
$tree->delete();
Note i tried to separate the text using and array but no luck? any pointers. Thanks