分享

delphi webbrowser 获取iframe

 梦游四海之图书 2018-04-23

procedure TForm1.Button4Click(Sender: TObject);
var
Index: Integer;
Document: IHTMLDocument2;
FrameIdx: OleVariant;
FrameDis: IDispatch;
FrameWin: IHTMLWindow2;
input:IHTMLElement;
cardno,name,money,selbank,paypwd,strbank:string;
P : TPoint;
begin
while Webbrowser1.ReadyState <> READYSTATE_COMPLETE do
Application.ProcessMessages;

if WebBrowser1.Document = nil then Exit;
if WebBrowser1.Document.QueryInterface(IHTMLDocument2, Document) <> 0 then Exit;

FrameIdx := 0;
FrameDis := Document.frames.item(FrameIdx);
if FrameDis.QueryInterface(IHTMLWindow2, FrameWin) <> 0 then Exit;
framedis:=framewin.document.frames.item(FrameIdx);
if FrameDis.QueryInterface(IHTMLWindow2, FrameWin) <> 0 then Exit;
//memo1.Lines.Add( framewin.document.body.outerHTML);
//FrameWin.document 就是你要的每个 Frame 的文档

end;

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多