How can I parse Name: & Value text from within the tag with DIHtmlParser? I tried doing it with TCLHtmlParser from Clever Components but it failed. Second question is can DIHtmlParser parse individual tags for example loop through its sub tags. Its a total nightmare for such a simple problem.
<div class="tvRow tvFirst hasLabel tvFirst" title="example1">
<label class="tvLabel">Name:</label>
<span class="tvValue">Value</span>
<div class="clear"></div></div>
<div class="tvRow tvFirst hasLabel tvFirst" title="example2">
<label class="tvLabel">Name:</label>
<span class="tvValue">Value</span>
<div class="clear"></div></div>
You could use
IHTMLDocument2DOM to parse whatever elements you need from the HTML:I wanted to mention another very nice HTML parser I found today:
htmlp(Delphi Dom HTML Parser and Converter). It’s not as flexible as theIHTMLDocument2obviously, but it’s very easy to work with, fast, free, and supports Unicode for older Delphi versions.Sample usage: