Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: HTML Table to MYSQL DB

by Fiddler (Initiate)
on Nov 02, 2011 at 15:12 UTC ( #935422=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^2: HTML Table to MYSQL DB
Re^3: HTML Table to MYSQL DB
by choroba (Abbot) 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... }
Re^3: HTML Table to MYSQL DB
by roboticus (Canon) 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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2014-08-20 08:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (107 votes), past polls