Link to home
Start Free TrialLog in
Avatar of chspit
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.
Avatar of D_M_D
D_M_D

ASKER CERTIFIED SOLUTION
Avatar of aelatik
aelatik
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chspit

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
Avatar of chspit

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("InternetExplorer.Application")
        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.InteropServices.COMException' occurred in microsoft.visualbasic.dll
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 )