procedure Tfrmmain.cmdmodiweb_info; var doc, frm: IHTMLDocument2; iw: IWebbrowser2; i: Integer; S: string; begin doc := WebBrowser1.Document as IHTMLDocument2; for i := 0 to doc.frames.Length - 1 do begin iw := GetFrame(i); frm := iw.Document as IHTMLDocument2;
// 直接找 class 名是:headBrand 的值 。可能更好。待加。
S := frm.body.outerHTML; if S.Contains('OFFICE Online') then begin S := S.Replace('OFFICE Online', 'MY NAME'); frm.body.outerHTML := S; end; end; end;
----------------------------------------------
-