Navigate through webpages

M

Mahesh

hi i have written a code where it opens a website and enter in by giving a
username and password. Then there is a serach box. I need to enter some data
into that search box which i have done the problem is now i am unable to
submit it. And once it enter into the next page it should click on a
particular link and should open that link from which i take the necessary
data. Please some one help me on this.
Private Sub CommandButton1_Click()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate "http://www.moodys.com/cust/default.asp"
.FullScreen = False
Do Until .readyState = 4: DoEvents: Loop
Do While .busy: DoEvents: Loop
Set mytextfield = .document.all.Item("userid")
mytextfield.Value = "amitavah"
Set mytextfield1 = .document.all.Item("passwd")
mytextfield1.Value = "amitava"
ie.document.forms("form1").submit
Set mytextfield2 = .document.all.Item("searchQuery")
mytextfield2.Value = "Aquila Inc"
ie.document.forms(0).submit
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top