Lazarus
Programming => Packages and Libraries => Topic started by: IndianaJones on July 19, 2011, 09:24:00 am
-
Hi all,
Has anyone experiencing with the William Yang HTMLParser?
I tried to compile the library but it gives the following error.
/Users/lazarus-libs/HtmlParser/HTMLParser.pas(96,69) Error: range check error in set constructor or duplicate set element
The error line is as follows.
Const
Breaks = [#0..' ', #$3A..#$40, '-', '~', '{', '"', '''', '\', '}', '<', '>', '='];
Any idea?
-
The last 3 characters:
'<', '>', '='
is already covered by:
#$3A..#$40
Just delete them.
-
Thanks Leledumbo
-
Hi again,
Has someone used this library before? Cos I cant figure out to get the text within the html tag like this.
In the following html text, I reached the href value, but not in the string.
<a href="/value/value">The text I want to get</a>
Any help would be appreciated. Thanks.
-
hi,
try write one on your own if you don't find a solution.
It's not that difficult.
Cheers,,
-
{$mode delphi}
uses
Interfaces,
HTMLParser,HTMLObjs;
const
aHTML = '<a href="/value/value">The text I want to get</a>';
var
aTag: TTagObject;
begin
with THTMLParser.Create do
try
Text := aHTML;
aTag := TagByName['a'];
WriteLn(aTag.InnerText);
finally
Free;
end;
end.