HTML解析器更新

增加了兼容性.
对于非标准的HTML做法,Tag中的<,>符号没有转义做了兼容.
HtmlParser
或者
http://code.google.com/p/delphi-html-parser/

此条目发表在Delphi, 未分类分类目录。将固定链接加入收藏夹。

HTML解析器更新》有188条回应

  1. 五毒说:

    感谢武大大~~一直在用这个html解析~

  2. Mark说:

    建议把NOscript 解析的时候加上过滤,比如Noscript里面包含 A 超链接,用css 搜索 A的时候别把他里面包括的列出来!就跟注释掉一样

  3. 匿名说:

    我表示这个网址完全打不开。。。

  4. 田攀说:

    请问怎么下载呢

  5. 匿名说:

    这个请问是哪个版本?d7编译不了,看语法貌似是xe的

  6. Pingback引用通告: max

  7. 管延亮说:

    感谢分享!赞一个。

  8. l说:

    感谢大侠,提个小建议哦,建议ihtmlelement名称改下,避免与mshtml定义中的名称重复,这样的话,如果有使用webbrowser不用再加mshtml.前缀了。

  9. 咨询说:

    {$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,谢谢

  10. Jimho说:

    可以增加一些常用的方法吗,比如
    getParentNode,
    getFirstNode,
    getPrevNode,
    getNextNode,
    。。
    这些节点类的操作,现在只有getChildren , 不太方便。

    谢谢

  11. 渔夫说:

    //获取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;

  12. lyt说:

    win7 64位 提示:“ range check error ” 请教下这个怎么解决,谢谢!
    gTagProperty.AddOrSetValue(Key[I], S);

  13. lyt说:

    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呢?

    • lyt说:

      奇怪,以前用低版本时不会出错,用10.2就出错了?

      • lyt说:

        if (I>0) and (I<=length(Key)) then //
        if gTagProperty.ContainsKey(Key[I]) then
        gTagProperty.AddOrSetValue(Key[I], S);
        武哥,我这样改行吗?

  14. Pingback引用通告: 43ytr.icu/j/GPoAr

  15. Pingback引用通告: bitly.com/AzAX3

  16. Pingback引用通告: tureckie_serialy_na_russkom_jazyke

  17. Pingback引用通告: 00-tv.com

  18. Pingback引用通告: Ñìîòðåòü âñå ñåðèè ïîäðÿä

  19. Pingback引用通告: watch

  20. Pingback引用通告: Video

  21. Pingback引用通告: +1+

  22. Pingback引用通告: 1 2 3 4 5 6 7 8 9 10

  23. Pingback引用通告: Watch TV Shows

  24. Pingback引用通告: Kinokrad 2019 Kinokrad Hd

  25. Pingback引用通告: Kinokrad

  26. Pingback引用通告: filmy-kinokrad

  27. Pingback引用通告: kinokrad-2019

  28. Pingback引用通告: filmy-2019-kinokrad

  29. Pingback引用通告: serial

  30. Pingback引用通告: cerialest.ru

  31. Pingback引用通告: youtube2019.ru

  32. Pingback引用通告: dorama hdrezka

  33. Pingback引用通告: movies hdrezka

  34. Pingback引用通告: HDrezka

  35. Pingback引用通告: kinosmotretonline

  36. Pingback引用通告: LostFilm HD 720

  37. Pingback引用通告: trustedmdstorefy.com

  38. Pingback引用通告: bofilm ñåðèàë

  39. Pingback引用通告: bofilm

  40. Pingback引用通告: 1 seriya

  41. Pingback引用通告: Êîíñóëüòàöèÿ ïñèõîëîãà

  42. Pingback引用通告: topedstoreusa.com

  43. Pingback引用通告: hqcialismht.com

  44. Pingback引用通告: viagramdtrustser.com

  45. Pingback引用通告: rick and morty season 3

  46. Pingback引用通告: See-Season-1

  47. Pingback引用通告: Evil-Season-1

  48. Pingback引用通告: Evil-Season-3

  49. Pingback引用通告: Evil-Season-4

  50. Pingback引用通告: Dollface-Season-1

  51. Pingback引用通告: Queer-Eye-We-re-in-Japan-Season-1

  52. Pingback引用通告: serial 2020

  53. Pingback引用通告: Dailymotion

  54. Pingback引用通告: Watch+movies+2020

  55. Pingback引用通告: serial-video-film-online

  56. Pingback引用通告: tvrv.ru

  57. Pingback引用通告: 1plus1serial.site

  58. Pingback引用通告: #1plus1

  59. Pingback引用通告: 1plus1

  60. Pingback引用通告: Watch Movies Online

  61. Pingback引用通告: Film

  62. Pingback引用通告: Film 2020

  63. Pingback引用通告: Film 2021

  64. Pingback引用通告: watch online TV LIVE

  65. Pingback引用通告: parazity-oskar-2020

  66. Pingback引用通告: human design

  67. Pingback引用通告: human design human design

  68. Pingback引用通告: DSmlka

  69. Pingback引用通告: viagra

  70. Pingback引用通告: viagra online

  71. Pingback引用通告: +

  72. Pingback引用通告: ¯jak Son³k

  73. Pingback引用通告: astrolog

  74. Pingback引用通告: film-kalashnikov-watch

  75. Pingback引用通告: generic cialis

  76. Pingback引用通告: cialis 20mg

  77. Pingback引用通告: kinoxaxru.ru

  78. Pingback引用通告: pobachennya u vegas

  79. Pingback引用通告: Proshanie so Stalinym

  80. Pingback引用通告: strelcov 2020

  81. Pingback引用通告: film t-34

  82. Pingback引用通告: online pharmacy

  83. Pingback引用通告: online pharmacy canada

  84. Pingback引用通告: Beograd film 2020

  85. Pingback引用通告: psiholog

  86. Pingback引用通告: psixolog

  87. Pingback引用通告: psyhelp_on_line

  88. Pingback引用通告: coronavirus

  89. Pingback引用通告: PSYCHOSOCIAL

  90. Pingback引用通告: rasstanovka hellinger

  91. Pingback引用通告: Cherekasi film 2020

  92. 大悟还俗说:

    你好,你的这个HtmlParser 单元,我在手机上测试时,发现报错了。测试 10.3.3

  93. Pingback引用通告: film doktor_liza

  94. Pingback引用通告: djoker film

  95. Pingback引用通告: t.me/psyhell

  96. Pingback引用通告: Ïñèõîëîã îíëàéí

  97. Pingback引用通告: bitly.com

  98. Pingback引用通告: viagra 100mg

  99. Pingback引用通告: viagra price

  100. Pingback引用通告: viagra generic

  101. Pingback引用通告: viagra coupon

  102. Pingback引用通告: cheap viagra

  103. Pingback引用通告: cialis

  104. Pingback引用通告: cialis coupon

  105. Pingback引用通告: canadian pharmacy cialis

  106. Pingback引用通告: cialis 5mg

  107. Pingback引用通告: rlowcostmd.com

  108. Pingback引用通告: bitly

  109. Pingback引用通告: movies-tekstmovies-tekst

  110. Pingback引用通告: Zemlyane 2005 smotret onlajn

  111. Pingback引用通告: smotret onlajn besplatno v kachestve hd 1080

  112. Pingback引用通告: gusmeasu.com

  113. Pingback引用通告: movies-unhinged-film

  114. Pingback引用通告: malenkie-zhenshhiny-2020

  115. Pingback引用通告: dom 2

  116. Pingback引用通告: zoom-psykholog

  117. Pingback引用通告: Vratar Galaktiki Film, 2020

  118. Pingback引用通告: Vratar

  119. Pingback引用通告: Cherkassy 2020

  120. Pingback引用通告: chernobyl-hbo-2019-1-sezon

  121. Pingback引用通告: moskva-psiholog

  122. Pingback引用通告: batmanapollo.ru

  123. Pingback引用通告: 323

  124. Pingback引用通告: 525

  125. Pingback引用通告: dom2-ru

  126. Pingback引用通告: Tenet Online

  127. Pingback引用通告: psy psy psy psy

  128. Pingback引用通告: krsmi.ru

  129. Pingback引用通告: like-v.ru

  130. Pingback引用通告: CFOSPUK

  131. Pingback引用通告: MAMprEj

  132. Pingback引用通告: fgu0ygW

  133. Pingback引用通告: batmanapollo

  134. Pingback引用通告: tsoy

  135. Pingback引用通告: 44548

  136. Pingback引用通告: 44549

  137. Pingback引用通告: hod-korolevy-2020

  138. Pingback引用通告: HD

  139. Pingback引用通告: 158444

  140. Pingback引用通告: groznyy-serial-2020

  141. Pingback引用通告: 38QvPmk

  142. Pingback引用通告: bitly.com/doctor-strange-hd

  143. Pingback引用通告: bitly.com/eternals-online

  144. Pingback引用通告: bitly.com/maior-grom

  145. Pingback引用通告: matrica-film

  146. Pingback引用通告: dzhonuikfilm4

  147. Pingback引用通告: bitly.com/batman20212022

  148. Pingback引用通告: bitly.com/venom-2-smotret-onlajn

  149. Pingback引用通告: bitly.com/nevremyaumirat

  150. Pingback引用通告: bitly.com/kingsmankingsman

  151. Pingback引用通告: bitly.com/3zaklyatie3

  152. Pingback引用通告: bitly.com/1dreykfilm

  153. Pingback引用通告: bitly.com/topgunmavericktopgun

  154. Pingback引用通告: bitly.com/flash2022

  155. Pingback引用通告: bitly.com/fantasticheskietvari3

  156. Pingback引用通告: bitly.com/wonderwoman1984hd

  157. Pingback引用通告: 1444

  158. Pingback引用通告: cleantalkorg2.ru

  159. Pingback引用通告: 232dfsad

  160. Pingback引用通告: cleantalkorg2.ru/sitemap.xml

  161. Pingback引用通告: join vk

  162. Pingback引用通告: vk login

  163. Pingback引用通告: svaty—7—sezon

  164. Pingback引用通告: svaty 7 sezon

  165. Pingback引用通告: svaty 7

  166. Pingback引用通告: tik tok

  167. Pingback引用通告: 666

  168. Pingback引用通告: The Revenant

  169. Pingback引用通告: 2021

  170. Pingback引用通告: D4

  171. Pingback引用通告: 777

  172. Pingback引用通告: link

  173. Pingback引用通告: 4569987

  174. Pingback引用通告: news news news

  175. Pingback引用通告: psy

  176. Pingback引用通告: psy2022

  177. Pingback引用通告: projectio-freid

  178. Pingback引用通告: kinoteatrzarya.ru

  179. Pingback引用通告: topvideos

  180. Pingback引用通告: afisha-kinoteatrov.ru

  181. Pingback引用通告: Ukrainskie-serialy

  182. Pingback引用通告: site

  183. Pingback引用通告: top

  184. Pingback引用通告: soderzhanki-3-sezon-2021.online

评论已关闭。