Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.03 c
15-1145097872
Volf_555
2006-04-15 14:44
2006.05.07
Как использовать функцию MONEY_FORMAT в PHP?


1-1143993365
TStas
2006-04-02 19:56
2006.05.07
Можно ли в экзешник собрать несколько файлов:


15-1144918326
_!
2006-04-13 12:52
2006.05.07
Контроль доступа к файлам и папкам


15-1144767485
Seldon
2006-04-11 18:58
2006.05.07
рендер HTML


3-1142597471
Гость1111
2006-03-17 15:11
2006.05.07
Работа с Метаданными в ORacle




   Наверх