Вниз
Скачать: 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.037 c
3-1142434109
RomanH
2006-03-15 17:48
2006.05.07
Добавление Jpeg в таблицу


3-1142008529
Kerk
2006-03-10 19:35
2006.05.07
Динамическое создание колонок в TdxDBGrid


15-1144594256
Gydvin
2006-04-09 18:50
2006.05.07
Сериалы


2-1145266351
NewUser1
2006-04-17 13:32
2006.05.07
трафик


15-1144835643
Гость101
2006-04-12 13:54
2006.05.07
Родительный падеж




   Наверх