<!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">
Hi,<br>
i believe the DOM access methods are the most annoying thing ever, you
can't just define<br>
a interface for all languages and expect it to be nice.<br>
<br>
Doesn't the LCL contains an XPath-parser?<br>
Then you could just use:<br>
html//div[@id="currency_converter_result"]/text()<br>
<br>
If not, you can use my parser from
<a href="http://benibela.de/sources_en.html#internettools">http://benibela.de/sources_en.html#internettools</a><br>
<br>
Benito<br>
<br>
On 30.01.2011 13:52, silvioprog wrote:
<blockquote
cite="mid:AANLkTinXjj8YCJ+1wGsYX74xVBJpKjVdpx5Fyn9S_ArH@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type"
content="text/html; charset=ISO-8859-1">
Sorry... but nobody? :(<br>
<br>
<div>2011/1/26 silvioprog <span><<a moz-do-not-send="true"
href="mailto:silvioprog@gmail.com">silvioprog@gmail.com</a>></span><br>
<blockquote>Hi guys,<br>
<br>
I use the GetElementById in PHP with sucess, but in FPC I not know how
use.<br>
<br>
In PHP I use (with sucess):<br>
<br>
...<br>
$dom = new DOMDocument();<br>
@$dom->loadHTML($data);<br>
$return = @$dom->getElementById('currency_converter_result')<br>
->getElementsByTagName('span')->item(0)->firstChild->wholeText;<br>
...<br>
<br>
In FPC I try (but without sucess):<br>
<br>
...<br>
var<br>
VHTMLDocument: THTMLDocument = nil;<br>
begin<br>
try<br>
ReadHTMLFile(VHTMLDocument, '../HTML/index.htm');<br>
ShowMessage(VHTMLDocument.GetElementById('currency_converter_result'<br>
).GetElementsByTagName('span').Item[0].FirstChild.TextContent);<br>
...<br>
<br>
I found a 'generic' solution:<br>
<br>
....<br>
ShowMessage(VHTMLDocument.GetElementsByTagName('div').Item[5].TextContent);
// This is a unique alternative? :o<br>
....<br>
<br>
Any idea? The GetElementById function works? :/<br>
<br>
Project to reproduce my problema in attached (with the HTML and PHP
files).<br>
<br>
( sorry for my bad english ^^' )<br>
<br>
Thanks.<br>
</blockquote>
</div>
<br>
-- <br>
<b>Silvio Clécio</b> <br>
<b>Blog.</b> <a moz-do-not-send="true"
href="http://blog.silvioprog.com.br"><span>blog.silvioprog.com.br</span></a><br>
<b>Twitter.</b> <a moz-do-not-send="true"
href="http://twitter.com/silvioprog">twitter.com/silvioprog</a> <br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
</body>
</html>