Solved

automate website navigation... from where to start?(newbie)

Posted on 2004-03-21
5
831 Views
Last Modified: 2011-09-20
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.
0
Comment
Question by:chspit
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:D_M_D
Comment Utility
0
 
LVL 14

Accepted Solution

by:
aelatik earned 500 total points
Comment Utility
You can use this, you can put the login first and the the data submission.

Private Sub Form_Load()
    Dim IE
    Set IE = CreateObject("InternetExplorer.Application")
        IE.Navigate "http://www.google.com"
        IE.Visible = True
  While IE.Busy
        DoEvents
  Wend
        IE.Document.All("q").Value = "My Name" ' contains the HTML name of the object
        IE.Document.All("btnG").Click ' contains the HTML name of the object
End Sub
0
 

Author Comment

by:chspit
Comment Utility
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
0
 

Author Comment

by:chspit
Comment Utility
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?
0
 
LVL 14

Expert Comment

by:aelatik
Comment Utility
"I would like to automate web navigation by using VB", so its VB code ( not .NET )
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now