<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks Cameron,<br>
<br>
It does indeed have that header, how do I make this work?<br>
<tt> XMLDocument1.FileName := 'c:\temp\test.htm';<br>
XMLDocument1.Active := True;<br>
</tt>Gives me various errors, I suspect that that the file is not valid
xml, or is there some other way of parsing it?<br>
<br>
<pre class="moz-signature" cols="72">Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
<a class="moz-txt-link-freetext" href="http://www.salespartner.co.nz">http://www.salespartner.co.nz</a>
PO Box 13085
Johnsonville
Wellington </pre>
<br>
<br>
Cameron Hart wrote:
<blockquote
cite="mid:DBC5CCA98A0EE4459C8BE38BF3028F1240654C@flowserver.flow.net.nz"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<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]-->
<div class="Section1">
<p class="MsoNormal"><span
style="font-size: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);">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: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Courier New"; color: windowtext;"><!DOCTYPE
html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"</a>><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Courier New"; color: windowtext;"><html
xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</a>><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);">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: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);">cameron</span><span
style="font-size: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);">
<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);"> </span><span
style="font-size: 9pt; font-family: "Trebuchet MS","sans-serif"; color: rgb(45, 58, 68);"><o:p></o:p></span></p>
<div>
<div
style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: windowtext;">From:</span></b><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: windowtext;">
<a class="moz-txt-link-abbreviated" href="mailto:delphi-bounces@delphi.org.nz">delphi-bounces@delphi.org.nz</a>
[<a class="moz-txt-link-freetext" href="mailto:delphi-bounces@delphi.org.nz">mailto:delphi-bounces@delphi.org.nz</a>] <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: 10pt;">p := iDoc.all.tags('P');</span></tt><span
style="font-size: 10pt; 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 moz-do-not-send="true" 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>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe</pre>
</blockquote>
</body>
</html>