in reply to Error handling with HTML::TableExtract

Hi,
yes, we need code examples. You don't really expect us to write some script for you without having proper input, desired output and so on, do you?
Please read How (Not) To Ask A Question to give us a chance to help you by providing a properly described problem.
Regards,
svenXY
  • Comment on Re: Error handling with HTML::TableExtract

Replies are listed 'Best First'.
Re^2: Error handling with HTML::TableExtract
by weismat (Friar) on Oct 17, 2007 at 09:30 UTC
    Example
    eval { my $url="zzz"; $response = $ua->get($url); if ($response->is_success) { $content=$response->content; } else { next; } $te= HTML::TableExtract->new(keep_html=>0); $te->parse($content); if ($te->table(3,3)->cell(1,0) eq "xxxx") { $a=$te->table(3,3)->cell(1,1); $b=$te->table(3,3)->cell(4,1); } else { $a=$te->table(3,4)->cell(1,1); $b=$te->table(3,4)->cell(4,1); } }; warn $@ if $@; }
    $te->table(3,3) does not exist in all cases and thus I always use eval instead of a proper error handling.