chspit
asked on
automate website navigation... from where to start?(newbie)
Hi
I would like to automate web navigation by using VB. I usually manage to write VBA code for ms applications(eg Outlook), but in this case I am stuck. I don't know from where to start.
My aim is to open a website, enter my username and password and hit the submit button, enter data in 2 data fields and hit the send button, then close the website...automatically.
Does Visual Studio.NET allow me to do such a thing. If yes, what project is suitable: ASP.NET Web Service, Console Application...? Preferably I would also need some code as an example to give me an idea.
Thanks in advance for your help.
I would like to automate web navigation by using VB. I usually manage to write VBA code for ms applications(eg Outlook), but in this case I am stuck. I don't know from where to start.
My aim is to open a website, enter my username and password and hit the submit button, enter data in 2 data fields and hit the send button, then close the website...automatically.
Does Visual Studio.NET allow me to do such a thing. If yes, what project is suitable: ASP.NET Web Service, Console Application...? Preferably I would also need some code as an example to give me an idea.
Thanks in advance for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi D_M_D
The websites you suggested are intended for those who want to create web forms. That is not my intention. I want to login to a website automatically, input data in a textbox, hit a button and exit, all automated.
The main question to get me going is: can I do this rom a Console application, or from an ASP.NET Web service?
Thanks
The websites you suggested are intended for those who want to create web forms. That is not my intention. I want to login to a website automatically, input data in a textbox, hit a button and exit, all automated.
The main question to get me going is: can I do this rom a Console application, or from an ASP.NET Web service?
Thanks
ASKER
Hi aelatik
Thanks for your code, but when I run it from Console (I am using Visual Studio.NET 2002) I receive an error. This is how I edited the code:
--------------------
Module WEB
Sub Main()
Dim IE
IE = CreateObject("InternetExpl orer.Appli cation")
IE.Navigate("http://www.go.com.mt/mygo/index.jsp")
IE.Visible = True
'While IE.Busy
'DoEvents()
'End While
IE.Document.All("go number").Value = "mynumber" ' contains the HTML name of the object
IE.Document.All("password" ).Value = "mypassword" ' contains the HTML name of the object
IE.Document.All("SUBMIT"). Click() ' contains the HTML name of the object
End Sub
End Module
--------------------
This is the error I reveived:
<<<An unhandled exception of type 'System.Runtime.InteropSer vices.COME xception' occurred in microsoft.visualbasic.dll
Additional information: Unspecified error>>>
What is wrong. Was your code supposed to be run from ASP.NET Web Service?
Thanks for your code, but when I run it from Console (I am using Visual Studio.NET 2002) I receive an error. This is how I edited the code:
--------------------
Module WEB
Sub Main()
Dim IE
IE = CreateObject("InternetExpl
IE.Navigate("http://www.go.com.mt/mygo/index.jsp")
IE.Visible = True
'While IE.Busy
'DoEvents()
'End While
IE.Document.All("go number").Value = "mynumber" ' contains the HTML name of the object
IE.Document.All("password"
IE.Document.All("SUBMIT").
End Sub
End Module
--------------------
This is the error I reveived:
<<<An unhandled exception of type 'System.Runtime.InteropSer
Additional information: Unspecified error>>>
What is wrong. Was your code supposed to be run from ASP.NET Web Service?
"I would like to automate web navigation by using VB", so its VB code ( not .NET )
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/introwebforms.asp
http://aspalliance.com/309
Example...
http://www.codeproject.com/aspnet/useraccountlogin.asp
--------
D_M_D