如何自动化Internet Explorer单击链接并输入数据? [英] How automate Internet Explorer clicking links and entering data?

查看:58
本文介绍了如何自动化Internet Explorer单击链接并输入数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够打开一个URL并输入一些数据,按一下按钮

然后等待页面加载,然后单击一个复选框和

按下另一个按钮。


在互联网上有关于如何使用vb.net执行此操作的好例子吗?


感谢您的光临任何帮助

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

推荐答案

嗨MeNo,


我认为你有一个特定的URL。


在这种情况下,看一下Html。你会看到表格的位置和输入所在的
。输入将具有名称或ID。表单将

有一个提交操作 - Post或Get。


任务是将数据输入文本框并单击复选框

和按钮等,对吗?

嗯,不太好。再试一次。


任务是将正确的值输入到这些输入中并获取表格

提交?

仍然不太对劲。再试一次。


任务是以< will>的方式调用URL如果

数据< have>已经输入并点击了框和按钮。?


正确!你没有< have>对网页本身做任何事情。 IE

不需要参与其中。如果你能弄清楚URL和发布

的行为是什么,你可以模拟整个事情。


这是一个例子:


此表单将向Google提交查询。

< form method =" GET"

action =" http://www.google.com/search"

name =" frmSearch" >

< input type =" text"名称= QUOT; Q" value =" Foo">

< input type =" submit"值= QUOT;搜索Google">

< / form>


这个网址也是如此:
http://www.google.com/search?q=Foo


这是模拟GET的简单方法。该URL与

输入文本并单击搜索按钮具有相同的效果。 (你可能可以使用与POST数据相同的

- 将其打包就好像是GET一样 - 但是我还没有测试过这个
。)


这有意义吗?它可能对你有用吗?

无论如何回来。


如果我们不能以艰难的方式解决问题 - 使用实际的

编程。并带上你的网页示例(请附上一个拉链)

然后说出你想要发生的事情。


问候,

Fergus

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


你好MeNotHome,

我不确定你想要什么,但你可以看一下 ;&的Webbrowser QUOT;在

MSDN

您的问题可以有很多答案。

Cor
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


是的,我也是这么想的。


但是,这些页面是基于asp的,其中一些不传递在cammand线上的

信息。当我从一个页面走到另一个页面以查看是否可行时,我仔细地看了一下地址栏

。这将是

没有。


还有其他想法吗?


谢谢


2003年9月24日星期三01:09:28 +0100,Fergus Cooney

< fi ****** @ tesco.net>写道:
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

On Wed, 24 Sep 2003 01:09:28 +0100, "Fergus Cooney"
<fi******@tesco.net> wrote:
嗨MeNo,

我认为你有一个特定的URL。

在这种情况下,采取一个看看Html。你会看到表格的位置和输入的位置。输入将具有名称或ID。表单将有一个提交操作 - Post或Get。

任务是将数据输入文本框并单击复选框
和按钮等,对吗?
嗯,不太好。再试一次。

任务是将正确的值输入到这些输入中并获取表单以提交?
仍然不太正确。再试一次。

任务是以< will>的方式调用URL。如果
数据< have>已经输入并点击了框和按钮。

正确!你没有< have>对网页本身做任何事情。 IE
不需要参与。如果你能弄清楚URL和发布的行为是什么,你可以模拟整个事情。

这是一个例子:

此表单会向Google提交一个查询。
< form method =" GET"
action =" http://www.google.com/search"
name =" frmSearch" >
< input type =" text"名称= QUOT; Q" value =" Foo">
< input type =" submit"值= QUOT;搜索Google">
< / form>

此网址也是如此:
http://www.google.com/search?q=Foo

这是模拟a的简单方法得到。该URL与输入文本并单击搜索按钮具有相同的效果。 (你或许能够和POST数据一样 - 把它打包好像是GET一样 - 但我还没有测试过这个。)

这有道理吗?它对你有用吗?
以任何一种方式回来。

如果我们不能用艰苦的方式解决问题 - 使用实际的编程。并带上您的网页示例(请附上拉链)
并说明您想要发生的事情。

问候,
Fergus
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






这篇关于如何自动化Internet Explorer单击链接并输入数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆