Ok - I got it. I was trying to read the html OnNavigateComplete2 - obviously the .document is not created at this point.
I changed it to OnDocumentComplete and everything is HunkyDunky > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Moore, Chris ( BIUK ) > Sent: 19 July 2007 12:11 > To: [email protected] > Subject: twebbrowser > > Hello list > > I am trying to scrape text from a web page, I found this code that > works: > > Fuction scrape(WB: TWebBrowser); > tr := ((wb.Document AS IHTMLDocument2).body AS > IHTMLBodyElement).createTextRange; > frm_main.Memo1.Text:=tr.text; > > However, the second time (and subsequent) a page is loaded my > app throws an exception. > > I can't clear the document, can someone help me to scrape > every page I surf to? > > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

