RSS订阅 | 匿名投稿
您的位置:网站首页 > 控件 > 正文

Delphi TWebBrowser get HTML source after AJAX load

作者:admin 来源: 日期:2015/4/16 20:21:46 人气: 标签:

function TBrowser.GetWebBrowserHTML(const WebBrowser: TWebBrowser): string;var  LStream: TStringStream;  Stream : IStream;  LPersistStreamInit : IPersistStreamInit;begin  try    if not Assigned(WebBrowser.Document) then exit;    LStream := TStringStream.Create('', TEncoding.UTF8);    try      LPersistStreamInit := WebBrowser.Document as IPersistStreamInit;      Stream := TStreamAdapter.Create(LStream,soReference);      LPersistStreamInit.Save(Stream,true);      result := LStream.DataString;    finally      LStream.Free();    end;  except  end;end;

读完这篇文章后,您心情如何?
0
0
0
0
0
0
0
0
本文网址:
下一篇:没有资料