Вниз
Скачать: 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.028 c
15-1144644621
TUser
2006-04-10 08:50
2006.05.07
Все будет хорошо ...


4-1139825664
Цукор5
2006-02-13 13:14
2006.05.07
SendMessage при разных вызовах форм


1-1144053468
intaari
2006-04-03 12:37
2006.05.07
Nul в StartString компонента TApdDataPacket


3-1142584000
de_ICER-T44
2006-03-17 11:26
2006.05.07
dbf Excel требуется грамотный ответ


2-1145380821
comtat
2006-04-18 21:20
2006.05.07
Проблема в Query




   Наверх