Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - How to get DOM on the landing page after a submit using aInternetExplorer.Application Obj

Reply
 
Old 01-12-2009   #1 (permalink)
gimme_this_gimme_that


 
 

How to get DOM on the landing page after a submit using aInternetExplorer.Application Obj

The following script visits a website log in page, does a POST, and
then navigates to the site's welcome page.

The Welcome page has a div whose id is "AAA".

But the IE object isn't getting refreshed with the DOM on the Welcome
page to see it.

What do I need to do?

Thanks.


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://www.mywebsite.com"

Do while IE.Busy
Loop

Set doc = IE.Document

Set form = doc.forms("login_form")
form.elements("password").value = "mypassword"
form.elements("logon").value = "mylogin"
form.submit

Do while IE.Busy
Loop

IE.Refresh -- Refresh isn't making it so I can see the DOM on the
Welcome page

Set doc = IE.Document
Set msg = doc.getElementById("AAA")
MsgBox msg.innerHTML ' Always null



My System SpecsSystem Spec
Old 01-12-2009   #2 (permalink)
gimme_this_gimme_that


 
 

Re: How to get DOM on the landing page after a submit using aInternetExplorer.Application Obj

Nevermind. This did it:

IE.Navigate IE.LocationURL

''''

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://www.mywebsite.com"

Do while IE.Busy
Loop

Set doc = IE.Document

Set form = doc.forms("login_form")
form.elements("password").value = "mypassword"
form.elements("logon").value = "mylogin"
form.submit

Do while IE.Busy
Loop

IE.Navigate IE.LocationURL
Set doc = IE.Document
Set msg = doc.getElementById("AAA")
MsgBox msg.innerHTML ' Works now


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Can'T submit form data from mail Vista mail
Using only 1/3 page file, but unable to load application Vista General
Using only 1/3 page file, but unable to load application Vista General
submit page PowerShell
How to submit page PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46