![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как из кода html выделить только текст? [D6, WinXP]
Volf_555 © (2006-01-19 17:40:00)Получаю html-текст с тегами следующим образом:
NMHTTP1.Get(' http://usergate/statistics.html');
memo1.Lines.Clear;
memo1.Text:=NMHTTP1.Body;
Как мне выделить из html-текста с тегами ТОЛЬКО ТЕКСТ?
Volf_555 (2006-01-19 18:20:00) [1]Твой код выдаёт html-текст вместе с тегами, а не только текст!
ZeFiR (2006-01-19 18:07:00) [2]
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;
или
var
Document: IHTMLDocument2;
begin
Document := WB.Document as IHtmlDocument2;
if Document < > nil then
Memo1.Text := (Document.all.Item(NULL, 0) as IHTMLElement).OuterHTML;