안녕하세요...
IESniffer 라는 인터넷익스플로러 콘트롤 컴포넌트를 테스트해보고 있는데요...
http://www.appcontrols.com/components.html
도움말 내용에 브라우저의 html 내용을 읽어오는 기능이 있는데 이게 델파이 코드라 난감하네요.. ^^;;
나름대로 수정을 해봤는데 동작이 안되요..
Example 1 (demonstrates how to read all content of downloaded HTML page)
uses MSHTML; // introduces IHTMLDocument2 interface
procedure TForm1.IESniffer1WBDownloadComplete(Sender: TObject;
const URL: String; const Browser: IWebBrowser2);
var
doc: IHTMLDocument2;
Collection: IHTMLElementCollection;
Element: IHTMLElement;
HTMLPage: String;
PlainText: String;
begin
try
doc := (Browser.Document as IHTMLDocument2);
Collection := doc.all;
Collection := Collection.Tags('BODY') as IHTMLElementCollection;
Element := Collection.Item(NULL, 0) as IHTMLElement;
HTMLPage := Element.OuterHTML; // read the HTML page
PlainText := Element.OuterText; // or just plain text
except
end;
end;
고수님들의 도움 부탁드립니다...
|