3

I want to open a webpage in internet explorer and navigate to a page and click on a button in the page using . For example

  • i I want to open IE and navigate to "http://www.gmail.com",
  • wait for the page to load,
  • and fill the username and password into the username and password text boxes and hit the sign in button using VB script.

This was the only thing i could find (only to open a page in IE ) :

Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("iexplore.exe www.gmail.com", 1) 

please help me out.

1

1 Answer 1

2

Something like:

 Set IE = CreateObject("InternetExplorer.Application") 
 Set WshShell = WScript.CreateObject("WScript.Shell") 
 IE.Navigate "http://mydomain.com/form.asp" 
 IE.Visible = True 
 Wscript.Sleep 2000 
 IE.Document.All.Item("Item1Id").Value = "1000" 
 IE.Document.All.Item("Item2Id").Value = "1001" 
 IE.Document.All.Item("Item3Id").Value = "Some Text" 
 Call IE.Document.Forms(0).Submit()
Sign up to request clarification or add additional context in comments.

2 Comments

but i couldn't navigate further this code..it opened a web page , entered the value in the text box , clicked the submit button and landed on another page. But I tried to take it a little further. .i tried to navigate from the screen which i landed to another page bu entering some values and clicking on the submit button..but i couldn't..
I tried like this Set IE = CreateObject("InternetExplorer.Application") Set WshShell = WScript.CreateObject("WScript.Shell") IE.Navigate "google.co.in" IE.Visible = True Wscript.Sleep 2000 IE.Document.All.Item("lst-ib").Value = "something" Call IE.Document.Forms(0).Submit() Wscript.Sleep 2000 IE.Document.All.Item("lst-ib").Value = "1001" here "lst-ib" is the id of the search text box

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.