Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: HTML Table to MYSQL DB

by choroba (Bishop)
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.

Replies are listed 'Best First'.
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.


      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, 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.


      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.
      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... }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935420]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-10-21 07:00 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (269 votes). Check out past polls.