http://www.perlmonks.org?node_id=935422


in reply to Re: HTML Table to MYSQL DB
in thread HTML Table to MYSQL DB

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: HTML Table to MYSQL DB
by roboticus (Chancellor) on Nov 02, 2011 at 15:35 UTC

    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.
Re^3: HTML Table to MYSQL DB
by choroba (Cardinal) on Nov 02, 2011 at 15:27 UTC
    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... }