Re: Accessing an HTML document's objects
From: Björn Holmgren (bjohol_at_hotmail.com)
Date: 06/16/04
- Next message: rmolnar: "visual basic - webbrowser + basic authentication"
- Previous message: Björn Holmgren: "Re: MSXML.XMLHTTPRequest freeze computer until response..."
- In reply to: Alan Lambert: "Accessing an HTML document's objects"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Jun 2004 14:12:28 +0200
"Alan Lambert" <AlanLambert@discussions.microsoft.com> wrote in message
news:5EEDEBC5-3EF3-471F-AA49-2126FE923135@microsoft.com...
> I'm trying to access the contents of an HTML document using the object
model. I know this can be done by using the WebBrowser control but I don't
want to display the page, just navigate through it. Setting the WebBrowser
control's visible property to false seems to prevent access to the DOM.
>
> Can anyone suggest an alternative method?
How about creating an instance of the InternetExplorer.Application class?
Example:
Const READYSTATE_COMPLETE = 4
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate2 "http://specify.url.here"
Do Until IE.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
' You can now access the DOM through the IE.Document property
IE.Quit
Set IE = Nothing
-- Björn Holmgren Guide Konsult AB
- Next message: rmolnar: "visual basic - webbrowser + basic authentication"
- Previous message: Björn Holmgren: "Re: MSXML.XMLHTTPRequest freeze computer until response..."
- In reply to: Alan Lambert: "Accessing an HTML document's objects"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|