|Pathologically Eclectic Rubbish Lister|
Queries on HTML::TableExtract - How to parse from saved html fileby howdoesitwork (Initiate)
|on Aug 08, 2012 at 08:11 UTC||Need Help??|
howdoesitwork has asked for the
wisdom of the Perl Monks concerning the following question:
Hello there, am pretty newish to perl,mainly have a java background, so do let me know if I'm missing something completely obvious.
I have been looking at various examples to try to get them to work, but so far haven't been able to get any using parse_file to work, only managed to get one working, but it was using parse() for parsing a html string.
For more background, I'm on windows 64 bit, and using strawberry perl, and I did install all the prerequisites for html::tableextract thru cpan. If possible, what I'd love is for an example of extracting table data from a html file already saved locally, and I should hopefully be able to fumble my way around from there.
Essentially, what I need to do is to extract some Table rows from a html file thats saved on my computer. And my apologies for the pretty horribly formatted post, and thanks for having a look!edit: can't seem to post in the thread, probably doing something wrong.
aitap: This is part of the file I'll be parsing (it's pretty horribly formatted, and there are empty td tags sometimes.)
As to examples, one I'm trying is http://search.cpan.org/~msisk/HTML-TableExtract-2.10/lib/HTML/TableExtract.pm but I seem to be missing something. I keep seeing a "can't call method "tree" on an undefined value at line 5" error when using this code from the TableExtracts examples(I have tried parsing in a html file $html_file = "page1.html"; , but it doesn't seem to be working)
(My input likely won't fit this, but I'm just trying to get an example working to start with, I know I'm missing something, but not quite sure what.
influx: I'll give that a shot, thanks. appreciate the responses!