Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.05.07;
Скачать: CL | DM;

Вниз

Как из кода html выделить только текст?   Найти похожие ветки 

 
Volf_555   (2006-01-19 17:40) [0]

Получаю html-текст с тегами следующим образом:
NMHTTP1.Get("http://usergate/statistics.html");
memo1.Lines.Clear;
memo1.Text:=NMHTTP1.Body;


Как мне выделить из html-текста с тегами ТОЛЬКО ТЕКСТ?


 
ZeFiR ©   (2006-01-19 18:07) [1]

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;


 
Volf_555   (2006-01-19 18:20) [2]

Твой код выдаёт html-текст вместе с тегами, а не только текст!



Страницы: 1 вся ветка

Текущий архив: 2006.05.07;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.03 c
4-1139995337
Nike
2006-02-15 12:22
2006.05.07
Перевод TFileTime в TDateTime


2-1145522700
Zaq123
2006-04-20 12:45
2006.05.07
Как создать текстовый файл с кодовой страницей 866?


2-1145374069
Lk
2006-04-18 19:27
2006.05.07
Работа с файлами


3-1141919015
RomanH
2006-03-09 18:43
2006.05.07
Начало работы с MS SQL Server


4-1139945594
Volf_555
2006-02-14 22:33
2006.05.07
Как свернуть/развернуть все MDI-окна в моём приложении?