<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Trebuchet MS";
panose-1:2 11 6 3 2 2 2 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
tt
{mso-style-priority:99;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
color:black;}
span.apple-style-span
{mso-style-name:apple-style-span;}
span.webkit-html-tag
{mso-style-name:webkit-html-tag;}
span.webkit-html-attribute-name
{mso-style-name:webkit-html-attribute-name;}
span.webkit-html-attribute-value
{mso-style-name:webkit-html-attribute-value;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Trebuchet MS","sans-serif";
color:#2D3A44;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";
color:black;}
span.doctype
{mso-style-name:doctype;}
span.start-tag
{mso-style-name:start-tag;}
span.attribute-name
{mso-style-name:attribute-name;}
span.attribute-value
{mso-style-name:attribute-value;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'>Do you know if the websites are xhtml – do they have anything
like below in the start of the page.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'><html xmlns="http://www.w3.org/1999/xhtml"><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'>If they are it would be easier to load them into XML documents
and process them that way using msxml DOMDocument60<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'>cameron</span><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'> </span><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";
color:#2D3A44'><o:p></o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> delphi-bounces@delphi.org.nz
[mailto:delphi-bounces@delphi.org.nz] <b>On Behalf Of </b>Alister Christie<br>
<b>Sent:</b> Friday, 29 January 2010 12:22 p.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> [DUG] web scraping using IHTMLDocument2<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I'm trying to do some web page scraping using
IHTMLDocument2, which is working fairly well and I can grab the second
paragraph on a web page by doing something like:<br>
<br>
<tt><span style='font-size:10.0pt'>p := iDoc.all.tags('P');</span></tt><span
style='font-size:10.0pt;font-family:"Courier New"'><br>
<tt>if p.Length >= 2 then</tt><br>
<tt> result := p.Item(1).InnerText;</tt><br>
</span><br>
Where iDoc is an isnstance of IHTMLDocument2.<br>
<br>
However say there there is an HTML element like<br>
<br>
<span class=webkit-html-tag><span style='font-size:13.5pt;font-family:"Courier New"'><div
</span></span><span class=webkit-html-attribute-name><span style='font-size:
13.5pt;font-family:"Courier New"'>class</span></span><span
class=webkit-html-tag><span style='font-size:13.5pt;font-family:"Courier New"'>="</span></span><span
class=webkit-html-attribute-value><span style='font-size:13.5pt;font-family:
"Courier New"'>propertyInfo</span></span><span class=webkit-html-tag><span
style='font-size:13.5pt;font-family:"Courier New"'>"></span></span><span
class=apple-style-span><span style='font-size:13.5pt;font-family:"Courier New"'>Price:
</span></span><span class=webkit-html-tag><span style='font-size:13.5pt;
font-family:"Courier New"'><span></span></span><span
class=apple-style-span><span style='font-size:13.5pt;font-family:"Courier New"'>Negotiation</span></span><span
class=webkit-html-tag><span style='font-size:13.5pt;font-family:"Courier New"'></span></div></span></span><span
style='font-size:13.5pt;font-family:"Courier New"'><br>
<br>
</span>How would I be able to find the divs where
class="propertyInfo"? (if anyone has much experience with
IHTMLDocument2) <o:p></o:p></p>
<pre>-- <o:p></o:p></pre><pre>Alister Christie<o:p></o:p></pre><pre>Computers for People<o:p></o:p></pre><pre>Ph: 04 471 1849 Fax: 04 471 1266<o:p></o:p></pre><pre><a
href="http://www.salespartner.co.nz">http://www.salespartner.co.nz</a><o:p></o:p></pre><pre>PO Box 13085<o:p></o:p></pre><pre>Johnsonville<o:p></o:p></pre><pre>Wellington <o:p></o:p></pre></div>
</body>
</html>