procedure TForm1.Button1Click(Sender: TObject); var i: Integer; tag: TclHtmlTag; begin Memo2.Lines.Clear(); clHtmlParser1.IncludeClosingTags := True; clHtmlParser1.ParseMethod := pmAll; clHtmlParser1.Parse(Memo1.Lines); for i := 0 to clHtmlParser1.Tags.Count - 1 do begin tag := clHtmlParser1.Tags[i]; if (tag.Name = 'div') and (tag.AttributeValue('class') = 'tvRow tvFirst hasLabel tvFirst') then begin Memo2.Lines.Add(GetInnerHtml(tag.Owner, tag)); end; end; end;
function TForm1.GetTagSource(ATag: TclHtmlTag): string; begin if ATag.IsClosingTag then begin Result := '</' + ATag.Name + '>'; end else if ATag.IsText then begin Result := ATag.TagSource; end else begin Result := '<' + ATag.TagSource + '>'; end; end; function TForm1.GetInnerHtml(AOwner, ATag: TclHtmlTag): string; begin if (ATag.NextTag <> nil) and (ATag.NextTag.Owner <> AOwner) then begin if (AOwner <> ATag.Owner) then begin Result := GetTagSource(ATag); end else begin Result := ''; end; Result := Result + GetInnerHtml(AOwner, ATag.NextTag); end else begin Result := GetTagSource(ATag); end; end;
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add admin@clevercomponents.com to your trusted senders list in your email software.