WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get text from HTML pages

 Keywords:  Get text from HTML pages OLE IE

Question:

Can anyone help me as to how I can get the text out of html pages? Can it be done? Please help!!

Answer:

Browser = ObjectOpen("InternetExplorer.Application")
browser.visible = @true
;browser.navigate ("c:\data\audit_trail.html") ;to access a local file
browser.navigate ("http://server01/page.html") ;to access an internet file

timedelay(2)
:top

if browser.readystate == 4 then
        BrowserDoc = Browser.Document
        BrowserBody = BrowserDoc.Body
        BrowserPage = BrowserBody.CreateTextRange
        BrowserText = BrowserPage.Text
else
        timedelay(1)
        goto top
endif

;out = fileopen("c:\bin\eaprint.txt", "write")
;filewrite(out, browsertext)
;fileclose(out)

message("Text", BrowserText)

exit



Article ID:   W14919
File Created: 2001:11:08:12:40:58
Last Updated: 2001:11:08:12:40:58