0

Im trying to automatically log into a website using a script so our employees don't have to remember the admin password.

Dim IE 
Dim Helem
Set IE =CreateObject("InternetExplorer.Application")  
IE.Visible = 1  
IE.navigate "http://rentalapp.zillow.com/"  
Do While (IE.Busy)   
WScript.Sleep 10  
LoopSet 
Helem = IE.document.getElementByID("formUsername")  
Helem.Value ="username"  
Set Helem =IE.document.getElementByID("formPassword")  
Helem.Value = "password" 
Set Helem = IE.document.Forms(0)  
Helem.Submit

I've gotten this far from other posts I've seen but I keep getting an error saying:

Line: 10 
char: 2 Error: 
Object required 
code: 800A01A8 
source: Microsoft VBScript runtime error

I've researched the code and and it says there is a typo somewhere but for the life of me I can't figure out where.

I'm not too familiar with vbscript but with functions like this I want to become more familiar with it. Please help.

2
  • Is LoopSet a typo? The Set keyword would belong in the next line. Commented Oct 11, 2013 at 13:00
  • No, Joe was right, formusername should be just username, I copied and pasted it from a prior script Commented Oct 11, 2013 at 13:16

2 Answers 2

2
Helem = IE.document.getElementByID("formUsername")  
Helem.Value ="username" <= this is line 10

Failed at line 10: looks like you failed to find an element with the ID "formUsername".

Take a look at the source of the page and check your ID is correct.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you soooo much, ha it was just username. But hey how can I pause before another action I want to navigate to another page 2 seconds after the submit button fires off
@Jay_the_noob - "how can I pause..." - ask google: stackoverflow.com/questions/4037180/…
0
Helem = IE.document.getElementByID("formUsername")  
==>
Set Helem = IE.document.getElementByID("formUsername")  

as later in your code.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.