Recent

Author Topic: HTML Table to TDataSet  (Read 2935 times)

jufau

  • New Member
  • *
  • Posts: 42
HTML Table to TDataSet
« on: July 28, 2015, 02:50:42 pm »
Hey Guys,
I need your help for the following task:
- I have to import data from HTML Table to my Lazarus Tdataset component, which will later transfer this data to my MySql Database.
So, is there any component or library that I can use to do such thing?

Thanks,
J

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: HTML Table to TDataSet
« Reply #1 on: July 28, 2015, 04:47:52 pm »
I have some class that kan import a HTML table into a self-made class.
It can handle only simple tables: no tables inside tables, no colspans, no rowspans.
It's just a custom made crude parser.

Using proper parsing (DOM) would be the proper way I guess.

Bart

jufau

  • New Member
  • *
  • Posts: 42
Re: HTML Table to TDataSet
« Reply #2 on: July 28, 2015, 04:54:51 pm »
Hey Bart,
Could you send me these files or at least show me the way you did them so I can implement it in my application?
Thanks
J

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: HTML Table to TDataSet
« Reply #3 on: July 28, 2015, 06:02:09 pm »
See http://svn.code.sf.net/p/flyingsheep/code/trunk/FarmedTools/.
The file htmlprocs.pp contains the code that parses the table structure.
See procedure HtmlTableToTableEmulator to see how I did it.

The actual project there is of no use to anybody (except to me and my co-workers) ...

Bart

jufau

  • New Member
  • *
  • Posts: 42
Re: HTML Table to TDataSet
« Reply #4 on: July 28, 2015, 06:24:46 pm »
Thanks Man,
I will check it out. But you already helped me a lot.

J

 

TinyPortal © 2005-2018