Re: Import data from HTML to MySQL
am 30.10.2007 12:32:48 von Jerry Stuckle
mfoolb wrote:
> Hi,
>
> I need to import lot of data from html files (all the same layout and
> tables name) to a MySQL db.
> Is there any class that fullfill my needs? What's the fastest way to
> accomplish that?
>
> TIA for help.
>
>
There isn't going to be a class which can take your HTML and import it
into MySQL (or any other database). But check out the DOM classes - you
can probably use them to parse your html, then add the data to MySQL
yourself.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Import data from HTML to MySQL
am 30.10.2007 14:28:54 von McKirahan
"mfoolb" wrote in message
news:1193657450.895951.305780@22g2000hsm.googlegroups.com...
>
> > You haven't provided enough information to answer the question.
>
> Well, that's fair..
>
> here it is the html code (it repeats):
>
> [...]
> Maincourses |
> TABLE> | | | |
> WIDTH=30>
> | | | Pasta | Format | XXXX
> B> | YYYYYYY
> | | | Name1 | Name1a | Q.ta1 | |
> CLASS=cr>Q.ta1b
> | | Name2 | Name2b | Q.ta2 | |
> CLASS=cr>Q.ta2b
> [...]
>
>
> Dessert |
> TABLE> | | | |
> WIDTH=30>
> | | | Cake | Type | XXXX
> | YYYYYYY
> | | | Name1 | Name1a | Q.ta1 | |
> CLASS=cc>Q.ta1b
> | | Name2 | Name2b | Q.ta2 | |
> CLASS=cc>Q.ta2b
> [...]
>
Reformatting the above into one tag per line (see below)
quicky reveals that the tables are improperly formatted.
The first | is not within a | ;
no closing or tags;
inconsistent number of columns in a row; et.al.
I wouldn't count on the pages remaining in this format!
[...]
|
|
|
|
|
|
| Pasta
| Format
| XXXX
| YYYYYYY
|
|
| Name1
| Name1a
| Q.ta1
| Q.ta1b
|
|
| Name2
| Name2b
| Q.ta2
| Q.ta2b
[...]
|
|
|
|
|
|
|
|
Cake
| Type
| XXXX
| YYYYYYY
|
|
| Name1
| Name1a
| Q.ta1
| Q.ta1b
|
|
| Name2
| Name2b
| Q.ta2
| Q.ta2b
[...]
|
|