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


15-1145094377
Volf_555
2006-04-15 13:46
2006.05.07
Текст в Internet Explorer стал отображаться курсивом!


2-1145209717
так себе
2006-04-16 21:48
2006.05.07
Помогите разобраться с Format ами


1-1143899915
Volf_555
2006-04-01 17:58
2006.05.07
Как сделать ОДИН щелчёк левой кнопкой мыши через SendMessage?


8-1131123964
serko
2005-11-04 20:06
2006.05.07
Звук и видео!




   Наверх