I made a local HTML test page to be parsed with my Perl script, this is my Perl code:
#!/usr/bin/perl
use WWW::Mechanize;
use HTML::TableExtract;
sub parse {
$mech = WWW::Mechanize->new(autocheck => 1);
$mech->get("file:///home/cafaro/omertascript/test.html");
$content = $mech->content();
$te = HTML::TableExtract->new(depth => 0);
$te->parse($content);
$table = $te->first_table_found;
$tree = $table->tree;
print $tree->cell(0,0);
}
parse();
... and this is my HTML code:
<html>
<head>
<title>test page</title>
<head>
<body>
<table>
<tr><td>parse me</td></tr>
</table>
</body>
</html>
|