//获取HTML自定义的元素,参数:html,ChildrenList下标列表任定义,例:1,3,7,0,0,1
function GetInnerText(Nodes: IHtmlElement; ChildrenList: string): string;
var strList: TStringList;
i, col: Integer;
e: IHtmlElement;
begin
Result := ”;
strList := TStringList.Create;
strList.Delimiter := ‘,’; //自定义条件字段
strList.DelimitedText := ChildrenList;
try
Pointer(e) := Nodes;
for i := 0 to strList.Count – 1 do begin
col := StrToInt(strList[i]);
Pointer(e) := e.Children[col];
if Pointer(e) = nil then
Exit;
end;
for I := low(FormatAsInlineTags) to high(FormatAsInlineTags) do
begin
Key := FormatAsInlineTags[I];
if gTagProperty.ContainsKey(Key) then
S := gTagProperty[Key]
else
S := 0;
S := S or tpFormatAsInline;
gTagProperty.AddOrSetValue(Key[I], S);
end;
——————————————————-
问题出在key[i]上,i为0时出错,请教一下这里为何不直接使用key呢?
感谢武大大~~一直在用这个html解析~
建议把NOscript 解析的时候加上过滤,比如Noscript里面包含 A 超链接,用css 搜索 A的时候别把他里面包括的列出来!就跟注释掉一样
做CSS过滤的时候你可以加上过滤条件把noscript过滤掉啊
我表示这个网址完全打不开。。。
请问怎么下载呢
这个请问是哪个版本?d7编译不了,看语法貌似是xe的
不会自己看,不是带了两个文件一个是个版本通用的,一个是XE3以上的.
Pingback引用通告: max
感谢分享!赞一个。
感谢大侠,提个小建议哦,建议ihtmlelement名称改下,避免与mshtml定义中的名称重复,这样的话,如果有使用webbrowser不用再加mshtml.前缀了。
{$IF NOT Declared(TStringDynArray)}
{$IFDEF USE_GENERICS}
TStringDynArray = TArray;
{$ELSE}
TStringDynArray = array of string;
{$ENDIF}
{$ENDIF}
最后一句报错 [DCC Error] HtmlParser.pas(130): E2029 $IFEND expected but $ENDIF found
这是什么情况? xe2,谢谢
可以增加一些常用的方法吗,比如
getParentNode,
getFirstNode,
getPrevNode,
getNextNode,
。。
这些节点类的操作,现在只有getChildren , 不太方便。
谢谢
//获取HTML自定义的元素,参数:html,ChildrenList下标列表任定义,例:1,3,7,0,0,1
function GetInnerText(Nodes: IHtmlElement; ChildrenList: string): string;
var strList: TStringList;
i, col: Integer;
e: IHtmlElement;
begin
Result := ”;
strList := TStringList.Create;
strList.Delimiter := ‘,’; //自定义条件字段
strList.DelimitedText := ChildrenList;
try
Pointer(e) := Nodes;
for i := 0 to strList.Count – 1 do begin
col := StrToInt(strList[i]);
Pointer(e) := e.Children[col];
if Pointer(e) = nil then
Exit;
end;
Result := e.InnerText; //获取HTML自定义的元素
finally
strList.Free;
Pointer(e) := nil;
end;
end;
procedure TForm4.btnTestClick(Sender: TObject);
begin
FNodes := parserHtml(Memo1.Text);
Memo2.Lines.Clear;
Memo2.Lines.Add(edtList.Text);
Memo2.Lines.Add(GetInnerText(FNodes, edtList.Text)); //获取HTML自定义的元素
end;
win7 64位 提示:“ range check error ” 请教下这个怎么解决,谢谢!
gTagProperty.AddOrSetValue(Key[I], S);
for I := low(FormatAsInlineTags) to high(FormatAsInlineTags) do
begin
Key := FormatAsInlineTags[I];
if gTagProperty.ContainsKey(Key) then
S := gTagProperty[Key]
else
S := 0;
S := S or tpFormatAsInline;
gTagProperty.AddOrSetValue(Key[I], S);
end;
——————————————————-
问题出在key[i]上,i为0时出错,请教一下这里为何不直接使用key呢?
奇怪,以前用低版本时不会出错,用10.2就出错了?
if (I>0) and (I<=length(Key)) then //
if gTagProperty.ContainsKey(Key[I]) then
gTagProperty.AddOrSetValue(Key[I], S);
武哥,我这样改行吗?
Pingback引用通告: 43ytr.icu/j/GPoAr
Pingback引用通告: bitly.com/AzAX3
Pingback引用通告: tureckie_serialy_na_russkom_jazyke
Pingback引用通告: 00-tv.com
Pingback引用通告: Ñìîòðåòü âñå ñåðèè ïîäðÿä
Pingback引用通告: watch
Pingback引用通告: Video
Pingback引用通告: +1+
Pingback引用通告: 1 2 3 4 5 6 7 8 9 10
Pingback引用通告: Watch TV Shows
Pingback引用通告: Kinokrad 2019 Kinokrad Hd
Pingback引用通告: Kinokrad
Pingback引用通告: filmy-kinokrad
Pingback引用通告: kinokrad-2019
Pingback引用通告: filmy-2019-kinokrad
Pingback引用通告: serial
Pingback引用通告: cerialest.ru
Pingback引用通告: youtube2019.ru
Pingback引用通告: dorama hdrezka
Pingback引用通告: movies hdrezka
Pingback引用通告: HDrezka
Pingback引用通告: kinosmotretonline
Pingback引用通告: LostFilm HD 720
Pingback引用通告: trustedmdstorefy.com
Pingback引用通告: bofilm ñåðèàë
Pingback引用通告: bofilm
Pingback引用通告: 1 seriya
Pingback引用通告: Êîíñóëüòàöèÿ ïñèõîëîãà
Pingback引用通告: topedstoreusa.com
Pingback引用通告: hqcialismht.com
Pingback引用通告: viagramdtrustser.com
Pingback引用通告: rick and morty season 3
Pingback引用通告: See-Season-1
Pingback引用通告: Evil-Season-1
Pingback引用通告: Evil-Season-3
Pingback引用通告: Evil-Season-4
Pingback引用通告: Dollface-Season-1
Pingback引用通告: Queer-Eye-We-re-in-Japan-Season-1
Pingback引用通告: serial 2020
Pingback引用通告: Dailymotion
Pingback引用通告: Watch+movies+2020
Pingback引用通告: serial-video-film-online
Pingback引用通告: tvrv.ru
Pingback引用通告: 1plus1serial.site
Pingback引用通告: #1plus1
Pingback引用通告: 1plus1
Pingback引用通告: Watch Movies Online
Pingback引用通告: Film
Pingback引用通告: Film 2020
Pingback引用通告: Film 2021
Pingback引用通告: watch online TV LIVE
Pingback引用通告: parazity-oskar-2020
Pingback引用通告: human design
Pingback引用通告: human design human design
Pingback引用通告: DSmlka
Pingback引用通告: viagra
Pingback引用通告: viagra online
Pingback引用通告: +
Pingback引用通告: ¯jak Son³k
Pingback引用通告: astrolog
Pingback引用通告: film-kalashnikov-watch
Pingback引用通告: generic cialis
Pingback引用通告: cialis 20mg
Pingback引用通告: kinoxaxru.ru
Pingback引用通告: pobachennya u vegas
Pingback引用通告: Proshanie so Stalinym
Pingback引用通告: strelcov 2020
Pingback引用通告: film t-34
Pingback引用通告: online pharmacy
Pingback引用通告: online pharmacy canada
Pingback引用通告: Beograd film 2020
Pingback引用通告: psiholog
Pingback引用通告: psixolog
Pingback引用通告: psyhelp_on_line
Pingback引用通告: coronavirus
Pingback引用通告: PSYCHOSOCIAL
Pingback引用通告: rasstanovka hellinger
Pingback引用通告: Cherekasi film 2020
你好,你的这个HtmlParser 单元,我在手机上测试时,发现报错了。测试 10.3.3
Pingback引用通告: film doktor_liza
Pingback引用通告: djoker film
Pingback引用通告: t.me/psyhell
Pingback引用通告: Ïñèõîëîã îíëàéí
Pingback引用通告: bitly.com
Pingback引用通告: viagra 100mg
Pingback引用通告: viagra price
Pingback引用通告: viagra generic
Pingback引用通告: viagra coupon
Pingback引用通告: cheap viagra
Pingback引用通告: cialis
Pingback引用通告: cialis coupon
Pingback引用通告: canadian pharmacy cialis
Pingback引用通告: cialis 5mg
Pingback引用通告: rlowcostmd.com
Pingback引用通告: bitly
Pingback引用通告: movies-tekstmovies-tekst
Pingback引用通告: Zemlyane 2005 smotret onlajn
Pingback引用通告: smotret onlajn besplatno v kachestve hd 1080
Pingback引用通告: gusmeasu.com
Pingback引用通告: movies-unhinged-film
Pingback引用通告: malenkie-zhenshhiny-2020
Pingback引用通告: dom 2
Pingback引用通告: zoom-psykholog
Pingback引用通告: Vratar Galaktiki Film, 2020
Pingback引用通告: Vratar
Pingback引用通告: Cherkassy 2020
Pingback引用通告: chernobyl-hbo-2019-1-sezon
Pingback引用通告: moskva-psiholog
Pingback引用通告: batmanapollo.ru
Pingback引用通告: 323
Pingback引用通告: 525
Pingback引用通告: dom2-ru
Pingback引用通告: Tenet Online
Pingback引用通告: psy psy psy psy
Pingback引用通告: krsmi.ru
Pingback引用通告: like-v.ru
Pingback引用通告: CFOSPUK
Pingback引用通告: MAMprEj
Pingback引用通告: fgu0ygW
Pingback引用通告: batmanapollo
Pingback引用通告: tsoy
Pingback引用通告: 44548
Pingback引用通告: 44549
Pingback引用通告: hod-korolevy-2020
Pingback引用通告: HD
Pingback引用通告: 158444
Pingback引用通告: groznyy-serial-2020
Pingback引用通告: 38QvPmk
Pingback引用通告: bitly.com/doctor-strange-hd
Pingback引用通告: bitly.com/eternals-online
Pingback引用通告: bitly.com/maior-grom
Pingback引用通告: matrica-film
Pingback引用通告: dzhonuikfilm4
Pingback引用通告: bitly.com/batman20212022
Pingback引用通告: bitly.com/venom-2-smotret-onlajn
Pingback引用通告: bitly.com/nevremyaumirat
Pingback引用通告: bitly.com/kingsmankingsman
Pingback引用通告: bitly.com/3zaklyatie3
Pingback引用通告: bitly.com/1dreykfilm
Pingback引用通告: bitly.com/topgunmavericktopgun
Pingback引用通告: bitly.com/flash2022
Pingback引用通告: bitly.com/fantasticheskietvari3
Pingback引用通告: bitly.com/wonderwoman1984hd
Pingback引用通告: 1444
Pingback引用通告: cleantalkorg2.ru
Pingback引用通告: 232dfsad
Pingback引用通告: cleantalkorg2.ru/sitemap.xml
Pingback引用通告: join vk
Pingback引用通告: vk login
Pingback引用通告: svaty7sezon
Pingback引用通告: svaty 7 sezon
Pingback引用通告: svaty 7
Pingback引用通告: tik tok
Pingback引用通告: 666
Pingback引用通告: The Revenant
Pingback引用通告: 2021
Pingback引用通告: D4
Pingback引用通告: 777
Pingback引用通告: link
Pingback引用通告: 4569987
Pingback引用通告: news news news
Pingback引用通告: psy
Pingback引用通告: psy2022
Pingback引用通告: projectio-freid
Pingback引用通告: kinoteatrzarya.ru
Pingback引用通告: topvideos
Pingback引用通告: afisha-kinoteatrov.ru
Pingback引用通告: Ukrainskie-serialy
Pingback引用通告: site
Pingback引用通告: top
Pingback引用通告: soderzhanki-3-sezon-2021.online