Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : Re: Convert HTML to Text
| Subject: | Re: Convert HTML to Text |
| Posted by: | "Eddie Shipman" (mrbaseball34@no_spam_gmail.com) |
| Date: | Tue, 18 Apr 2006 15:18:24 |
In article <44449415$1@newsgroups.borland.com>,
francois.piette@overbyte.be says...
> > Very easy to parse text from HTML using IHTMLDocument2.
> >
> >
> > uses ...,mshtml, ActiveX, ComObj;
> >
> > procedure TForm1.Button1Click(Sender: TObject);
> > var
> > IDoc: IHTMLDocument2;
> > sHTMLFile: String;
> > v: Variant;
> > begin
> > sHTMLFile := idHTTP1.Get('http://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;
>
> Where is the parsing in your code ?
> Maybe we don't use the term "parsing" to designate the same thing ?
> For me, parsing means analysing the HTML code to extract tags, attributes
> values, comments, data and so on.
>
Picky today????
The OP wanted Text from HTML, I mistakenly used the word PARSING.
none