I have an html page with a table that has 300 rows.

It has 12 columns and all the data in the columns is plain text except the data in two of the columns: one column houses urls and the other is a drop down list.

The first row of the table houses headings for each of the columns and I have constructed a mysql table that has the same fields as the column names.

The page changes every week.

Is there anyway to write a script or to ammend the page so that I can do an easy insert into the mysql table?

    When you say the page changes, what is changing the page?

    The obvious answer is to go back to the source of the HTML and get the updates from there. If that doesn't work you might have to parse out the HTML as if it's XML. That could be easy or hard depending on the HTML.

    Another possibility is to send the HTML table to Internet Explorer with the HTTP header indicating it should be displayed as an Excel spreadsheet; once in Excel there are other options to move it into a database.

      thanks. The client provides the data as an html page and I have to sort through and figure out what has changed.

      Sorry, I'm not exactly sure what you been by parse out the html as if it is xml? Can you possibly direct me to a tutorial which describes how I do this? I know absolutely zero about xml.

      thanks for all of your help--very appreciated!

        18 days later

        Well, I haven't got to the script part but there are some work arounds.

        Save the web page and open in dreamweaver

        In Dreamweaver, in design view you can go to file , export, table, text and export the table as a tab delimited txt file

        Another option is to use navicat (paid, though there is a trial version) the latest beta has a rather good html import.

          Write a Reply...