Hello dear Community, good evening!
My first perl-parser runs very well. BTW: Well i am very very glad to be here - this is a great place and i have a nice learning curveā¦This forums give me a great asset of learning!! Many many thanks to all that helped me here in this great place. I love these forums!!
**What is aimed today:**i am parsing site with a small table and some labels and values:
click the link and see the page with the Schulinformationen
Note:This page [and many others that are simmilar] is/are stored locally in the same folder as file t.html
Now i want to store the data in a MySQL-DB: i am figuring out how to do this:
here the code:
#!/usr/bin/perl
use strict; use warnings;
use HTML::TableExtract;
use YAML;
my $te = HTML::TableExtract->new(
attribs => { class => 'bp_ergebnis_tab_info' },
);
$te->parse_file('t.html');
foreach my $table ( $te->tables ) {
foreach my $row ($table->rows) {
my @values = grep {defined} @$row;
print " ", join(',', @values), "
";
}
}
Note - the output is very vey nice !
I currently work on the code that is needed to store the data in a MySQL-DB. I need a starting point for the creation of this db. Well see the labels and the values:
Schulnummer, 143960
Amtliche Bezeichnung,Franziskusschule Kath. Hauptschule Ahaus - Sekundarstufe I
Strasse, Hof zum Ahaus 6
Plz und Ort, 48683 Ahaus
Telefon, 02561 4291990
Fax, 02561 42919920
E-Mail-Adresse, 3960@schule.nrw.de
Well, currently i am working on the interaction of the script with the database. Well, i look forward to some ideas - any and all ideas & hints for the starting point will be greatly appreciated.
Greetings
meta