1.wb.OleObject.document.documentelement.innerhtml
2.utf8toansi(getHtml(wb))
utf8toansi函数
function getHtml(const WebBrowser:TWebBrowser):string; const BufSize = $10000; var Size: Int64; Stream: IStream; hHTMLText: HGLOBAL; psi: IPersistStreamInit; begin if not Assigned(WebBrowser.Document) then Exit; OleCheck(WebBrowser.Document.QueryInterface(IPersistStreamInit,pSi)); try hHTMLText := GlobalAlloc(GPTR,BufSize); OleCheck(CreateStreamOnHGlobal(hHTMLText,True,Stream)); try OleCheck(Psi.Save(Stream,False)); Size := StrLen(PChar(hHTMLText)); SetLength(Result,Size); CopyMemory(PChar(Result),Pointer(hHTMLText),Size); finally Stream := nil; end; finally pSi := nil; end; end;