deadice
asked on
How to retrive values from an HTML table?
I'm looking for a way to populate a listview or grid control with the contents of an HTML table from on of our intranet sites. What can I use to parse HTML tables?
ASKER
DOM is part of Java, correct? I need a solution in C++ / MFC.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ah, I see. Sample code would be nice. Perhaps you have a link?
ASKER
Any further suggestions?
Look up the IHtmlDocumentX etc. interfaces. Typically you would:
- acquire the IHtmlDocument somehow (depends on your app)
- Get the IHtmlElement for the Table (depends of the page, best would be giving the table an "id=" attribute)
- QI for IHtmlTable
- IHTmlTable::rows returns an IHtmlElementCollection of the rows, where each element can be QI'd for IHtmlTableRow itf
- IHTmlTableRow returns an IHtmlElementCollection of the rows, where each element can be QI'd for IHtmlTableCell itf
(you can use Colums instead of Rows)
Peter