Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: HTML Table to MYSQL DB

by choroba (Abbot)
on Nov 02, 2011 at 15:01 UTC ( #935420=note: print w/ replies, xml ) Need Help??


in reply to HTML Table to MYSQL DB

I would use HTML::TableExtract.


Comment on Re: HTML Table to MYSQL DB
Re^2: HTML Table to MYSQL DB
by Fiddler (Initiate) on Nov 02, 2011 at 15:12 UTC
    how exactly would you use that? I can install CPAN modules but I've never used them.
      Something like this:
      use warnings; use strict; use HTML::TableExtract; use LWP::Simple; my $T = HTML::TableExtract->new(); my $table = $T->parse(get( 'http://.......')) ->first_table_found; my @rows = $table->rows; for my $row (@rows) { # Process rows... }

      Fiddler:

      how exactly would you use that? I can install CPAN modules but I've never used them.

      I'd first install it. Then I'd read the documentation, and put the code in the synopsis into a file, say foo.pl, and tweak it a little based on the documentation and the HTML I was trying to parse. Next, I'd run it and see what happened.

      Once I get to the point where I can read the data, I'd write some code to write the data into the database.

      If it worked, then I'd be done. On the other hand, if it didn't work, then I'd look to see if there were any error messages. If so, I'd try to figure out what the error messages were trying to tell me. If I couldn't figure it out, then I'd post my code, my HTML and my question on Perlmonks to see if anyone could lend a hand.

      That's exactly what I'd do.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

        OK. Cracking i shall get. Will post my program as soon as i get to any hurdels. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-09-23 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls