saeen has asked for the wisdom of the Perl Monks concerning the following question:
This doesn't give me a neat output like the phone numbers don't show proper, email doesn't show at all, address and some other fields have some java scripts in it. I just want to extract the main information and display neatly. Any help would be appreciated. Output of this script is given below:#!/usr/bin/perl use strict; use warnings; use HTML::TableExtract; my $te; my $ts; my $html_string; my $filename='1385-AIM-Legal.aspx.html'; my $row; my $col; open(my $fh, '<', $filename) or die "cannot open file $filename"; { local $/; $html_string = <$fh>; } close($fh); my $headers = ['Phone']; $te = HTML::TableExtract->new(depth => 2); $te->parse($html_string); foreach $ts ( $te->tables() ) { foreach $row ( $ts->rows() ) { print join ( "\t", @$row ), "\n"; } }
Use of uninitialized value in join or string at ./parsehtml.perl line +32. AIM Legal Phone 03 9...setTimeout("document.getElementById('Phone1').innerHTM +L='03 9482 4607'",1000); Fax 03 9...setTimeout("document.getElementById('Phone2').innerHTML= +'03 9482 4607'",1000); Email var s='=b!isfg>(nbjmup;bjnmfhbmAcjhqpoe/dpn(?bjnmfhbmAcjhqpo +e/dpn=0b?';var i;for (i=0;i<s.length;i++) document.write( String.from +CharCode(s.charCodeAt(i)-1)); Street Address Michael StreetsetTimeout("document.getElementById(' +Address1').innerHTML='14 Michael Street'",1000); Fitzroy North. VIC 3065
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with HTML::TableExtract
by Corion (Patriarch) on Mar 12, 2015 at 09:15 UTC | |
by saeen (Novice) on Mar 12, 2015 at 09:35 UTC | |
by AppleFritter (Vicar) on Mar 12, 2015 at 10:19 UTC | |
by Corion (Patriarch) on Mar 12, 2015 at 09:38 UTC |