VbScript has method called getElementById to get the particular element in a HTML page using HTML Id

The below example shows an VbScript which will lunch the browser goes to google page find the search text box and enter the value

Example Code

On Error Resume Next
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate "http://google.com"
ie.Visible = True
WScript.Sleep 2000
ie.document.getElementById("gbqfq").Value = "hello"

Syntax

Document.getElementById("element-name")
Document.Form-Name.Elements("element-name")

Here one more example to get the value using getElementById in vbscript



ThaiCreate.Com Tutorial