|
uses ...,mshtml, ActiveX, ComObj;
procedure TForm1.Button1Click(Sender: TObject);
var
IDoc: IHTMLDocument2;
sHTMLFile: String;
v: Variant;
begin
sHTMLFile := idHTTP1.Get('www.mysite.com');
Idoc:=CreateComObject(Class_HTMLDOcument) as IHTMLDocument2;
try
IDoc.designMode:='on';
while IDoc.readyState<>'complete' do
Application.ProcessMessages;
v:=VarArrayCreate([0,0],VarVariant);
v[0]:= sHTMLFile;
IDoc.write(PSafeArray(System.TVarData(v).VArray));
IDoc.designMode:='off';
while IDoc.readyState<>'complete' do
Application.ProcessMessages;
Memo1.Lines.Text := IDoc.body.innerText;
finally
IDoc := nil;
end;
end;
|
|