Recent

Author Topic: [SOLVED]William Yang HTMLParser Compile Problem  (Read 8561 times)

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
[SOLVED]William Yang HTMLParser Compile Problem
« 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?
« Last Edit: July 19, 2011, 07:34:29 pm by IndianaJones »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8777
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: William Yang HTMLParser Compile Problem
« Reply #1 on: July 19, 2011, 04:22:10 pm »
The last 3 characters:
Code: [Select]
'<', '>', '='is already covered by:
Code: [Select]
#$3A..#$40Just delete them.

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: William Yang HTMLParser Compile Problem
« Reply #2 on: July 19, 2011, 07:32:49 pm »
Thanks Leledumbo

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: [SOLVED]William Yang HTMLParser Compile Problem
« Reply #3 on: July 20, 2011, 04:38:56 am »

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.

Sora-Kun

  • Full Member
  • ***
  • Posts: 162
  • I can smell your presence ...
    • Sora-Kun
Re: [SOLVED]William Yang HTMLParser Compile Problem
« Reply #4 on: August 01, 2011, 01:57:40 pm »
hi,
try write one on  your own if you don't find a solution.
It's not that difficult.

Cheers,, 
if nothing suites you, make it your self!
The Revolution, Genesis. The next generation IDE.
If you want to help, PM me.

Made in Lazarus.
Soon, in The WWW.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8777
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [SOLVED]William Yang HTMLParser Compile Problem
« Reply #5 on: August 02, 2011, 12:12:05 am »
Code: [Select]
{$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.

 

TinyPortal © 2005-2018