Solved

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

Posted on 2004-03-21
5
838 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:D_M_D
ID: 10644306
0
 
LVL 14

Accepted Solution

by:
aelatik earned 500 total points
ID: 10644643
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
ID: 10644748
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
ID: 10645326
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
ID: 10646861
"I would like to automate web navigation by using VB", so its VB code ( not .NET )
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

732 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