VBScript to launch a secure website login

October 31, 2009 at 06:18:31
Specs: Windows XP, 512MB
Hi all,

I almost got what I was looking for but this time its related to a secure website. I wish to launch a secure site and log onto it using the username and password supplied in the vbscript file. Razor had posted the below code for a normal website login. It's a great code but I don't know where am I going wrong for a secure site... Do I need to add any other string/code?

WScript.Quit Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "http://www.gmail.com"
  Wait IE
  With IE.Document
    .getElementByID("Email").value = "nilesh.david"
    .getElementByID("Passwd").value = ""
    .getElementByID("gaia_loginform").submit
  End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy 
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy 
End Sub

Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
End Sub

Thanks for any help...


See More: VBScript to launch a secure website login

Report •


#1
October 31, 2009 at 21:18:14
From Nilesh.David 05:55:17 10/31/2009 (reply).
Hi Razor, I read your post about using VBScript to start a website and logonto it using the usernames and passwords provided. But, I need a script that will be used for a secure website. I tried your method but it gives me a "getElement" error...
Any help would be much appreciated.
----------------------------------------------------

Your example is working for me, I don't know why you can't access the DOM. The only thing I could suggest would be to add a

WScript.Sleep 5000

before the first .getElementByID().

Alternatively, you could try changing the address to "https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false"


Report •
Related Solutions


Ask Question