How automate Internet Explorer clicking links and entering data?

  • Thread starter Thread starter MeNotHome
  • Start date Start date
M

MeNotHome

I need to be able to open up a URL and enter some data, press a button
and then wait for the page to load and then click a check box and
press another button.

Is there a good example on the internet on how to do this with vb.net?

Thanks for any help
 
Hi MeNo,

I presume that you have a particular URL in mind.

In that case, take a look at the Html. You'll see where the Forms are and
where your inputs are. The inputs will have a name or an id. The form will
have a submit action - either Post or Get.

The task is to enter the data into the textboxes and click the checkboxes
and buttons, etc, right ?
Well, not quite. Try again.

The task is to get the right values into those inputs and get the Form to
submit?
Still not quite right. Try again.

The task is to call the URL in the way that it <would> be called if the
data <had> been entered and the boxes and buttons clicked.?

Correct! You don't <have> to do anything with the web page itself. IE
doesn't need to be involved. If you can work out what the URL and posting
behaviour is going to be, you can simulate the whole thing.

Here's an example:

This form will submit a query to Google.
<form method="GET"
action="http://www.google.com/search"
name="frmSearch" >
<input type="text" name="q" value="Foo">
<input type="submit" value=" Search Google ">
</form>

So will this URL:
http://www.google.com/search?q=Foo

This is how easy it is to simulate a GET. The URL has the same effect as
entering the text and clicking the Search button. (You may be able to do the
same with POST data - package it up as if it were a GET - but I haven't tested
this.)

Does this make sense? And could it be of any use to you?
Come back either way.

If it isn't we can work something out the hard way - using actual
programming. And bring examples of your web pages (attached in a zip, please)
and say what you want to happen.

Regards,
Fergus
 
Hi MeNotHome,
I am not sure what you want, but you can take a look for "Webbrowser" on
MSDN
Your question can have a lot of answers.
Cor
 
Yes, I thought of that too.

However, the pages are asp based and some of them do not pass the
information on the cammand line. I watched the address bar carefully
when I stepped from page to page to see if that would work. It would
not.

Any other ideas?

Thanks
 
I need to create a browser control in a window. Then within this
browser control access a certain .ASP page and enter various
information and press the submit button.

page 1 is a login and password and press submit.
page 2 is click on three different links in succession
page 3 is enter start date, end date and press submit
page 4 is click a check box and press a another button.

I need this fully automate so a person does not have to do it.
We can put it on a timer and activate two or three times a day.

Thanks for any advice
 
Hi MeNo,

Are the pages local to you or on the Internet? Could you give us the URLs?
Or zip the web pages and post them?

One approach that I use with mail.com is that I have my own copy of the
login page. I've taken out all the junk and added in some Javascript (called
from body.onload) which sets the username and password fields to my details
and then calls submit. I don't go to mail.com I simply haul my login page into
IE and off it goes.

If you know the content of the pages that you are interested in, you could
do the same. I expect the login page is pretty much static. If the content
changes on the others, you could obtain the pages using the Framework's Net
classes and then insert the appropriate changes textually. Save this to a file
and then it load into your browser (IE or WebBrowser control, whichever) and
off it goes.

Regards,
Fergus

ps. I'm not syaing the get-IE-to-poke-data-and-buttons approach won't work - I
just don't know how to do it.
 
No, I don't think I should post the page since it is on the internet
and it's password protected.

Thanks for the ideas about creating a personal login page.

I am sure there is a way to access the objects on a web page inside a
webbroswer control. I just need to learn how to do it.

Thanks for any further advice.
 
Hi MeNo,

Are the pages local to you or on the Internet? Could you give us the URLs?
Or zip the web pages and post them?

One approach that I use with mail.com is that I have my own copy of the
login page. I've taken out all the junk and added in some Javascript (called
from body.onload) which sets the username and password fields to my details
and then calls submit. I don't go to mail.com I simply haul my login page into
IE and off it goes.

If you know the content of the pages that you are interested in, you could
do the same. I expect the login page is pretty much static. If the content
changes on the others, you could obtain the pages using the Framework's Net
classes and then insert the appropriate changes textually. Save this to a file
and then it load into your browser (IE or WebBrowser control, whichever) and
off it goes.

Regards,
Fergus

ps. I'm not syaing the get-IE-to-poke-data-and-buttons approach won't work - I
just don't know how to do it.
 
The initial part of the website is fairly static. ie login via user
name and password. Then click a couple of links.

However the important part at the end is very dynamic.

Thanks for any help
 
Hi MeNo,

|| Thanks for any help

Are you saying thanks for what I've given or asking for more? ;-)

If more, then please discuss what I've talked about and how much of it you
can or can't use, and then give me some indication of where you want to go.

Regards,
Fergus
 
Hi MeNo,

ps. You <still> haven't given us any zipped pages or URL's. It's a little dark
in this cellar, if you get my drift. ;-)

Regards,
Fergus
 
Back
Top