Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: Сети > Как получить текст HTML Документа из TWebBrowser без тегов


Автор: Poseidon 18.5.2005, 23:36
Код
uses mshtml, activex; 

procedure GetHtmlCode(WebBrowser: TWebBrowser; FileName: string); 
var 
 htmlDoc: IHtmlDocument2; 
 PersistFile: IPersistFile; 
begin 
 htmlDoc := WebBrowser.document as IHtmlDocument2; 
 PersistFile := HTMLDoc as IPersistFile; 
 PersistFile.save(StringToOleStr(FileName), true); 
end; 


Взято с http://delphiworld.narod.ru 

------------------------------------------------------------------------------

Код
var 
  Document: IHTMLDocument2; 
begin 
 Document := WB.Document as IHtmlDocument2; 
 if Document < >  nil then 
   Memo1.Text := (Document.all.Item(NULL, 0) as IHTMLElement).OuterHTML; 


Взято с http://delphiworld.narod.ru 

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)