Главная страница
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.043 c
1-1143488106
kutuzov47
2006-03-27 23:35
2006.05.07
Программно назначить объекту ShortCut


3-1142414454
thvfrjd
2006-03-15 12:20
2006.05.07
Проблема с хранимой процедурой


2-1145460774
simplelame
2006-04-19 19:32
2006.05.07
FR 3.0


15-1145135589
Shastox
2006-04-16 01:13
2006.05.07
Старая загадка на новый лад


6-1137414584
Dark Lord
2006-01-16 15:29
2006.05.07
Как в WebBrowser заменить контекстное меню своим собственным