| |

VerySource

 Forgot password?
 Register
Search
View: 749|Reply: 1

Convert HTML to Text

[Copy link]

1

Threads

1

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 Taiwan

Post time: 2022-3-10 09:42:25
| Show all posts |Read mode
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;
Reply

Use magic Report

0

Threads

3

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2022-3-15 10:33:40
| Show all posts
怎么我不能下载里面的资源呢
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list