February 09, 2009

Open Yahoo Mail through Windows Script


Hi People,

I'm a Newbie to scripting world. I thought of writing a windows script which will take my credentials and automatically logs me into yahoo. With lots of googling i  m able to write the following code:

set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "www.mail.yahoo.com"
objIe.Visible = true

'wait untill page gets loaded
While objIE.busy
WScript.Sleep 1000
Wend

objIE.document.getElementByID("username").value = "my_username"
objIE.document.getElementByID("passwd").value = "my_password"
 objIE.document.getElementsByName(".save")(0).click()

That's it. Copy and paste the above code. Yeah pls fill corresponding username and password fields. This code needs to be worked in the following sections:

1)Inside the if condition i m finding the username textbox through DOM selection and then filling in the appropriate fields. But this may affect if the textbox name changes.

The following are some of the links where u can find some more useful information:






0 comments: