以编程方式与 IE 浏览器交互以填写表单和导航等 [英] Programatically interact with the IE browser to fill in forms and navigate etc

查看:27
本文介绍了以编程方式与 IE 浏览器交互以填写表单和导航等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 C# 与 IE 浏览器进行交互.

I'd like to use C# to interact with the IE browser.

感觉会涉及到shdocvw.dll,但是里面的类太多了,不知道从何说起,可能根本没必要用.

I have a feeling that shdocvw.dll will be involved, but there are so many classes in there that I don't know where to start, and maybe it's not even necessary to use it.

此处的目标是与网站交互、访问其页面并预热",这与 Kenneth Scott 所述.问题是,JavaScript 会在您与网站交互时执行,因此能够像在网站上一样登录/提交表单就好了.

The goal here is to interact with a website, visiting it's pages and "warming it up," not unlike as described here by Kenneth Scott. The thing is, javascript is getting executed as you interact with a website, so it would be nice just to be able to login / submit forms exactly as you would on the website itself.

另外,如果能够创建一个程序来记录我在 IE 中的操作,然后能够稍微自动化并稍微修改它们,那就太好了.

Plus it would be nice to be able to create a program that records my actions in IE, and then be able to slightly automate and slightly modify them.

此外,如果它可以在后台完成所有这些工作,而根本不必显示网页,那就太好了.

Additionally, it would be nice if it could do all this in the background, without having to display the webpage at all.

我不是在寻找第三方解决方案,我想自己做(当然有你的建议.)

I'm not looking for third party solutions, I want to do this myself (with your advice of course.)

谢谢.

推荐答案

您说您不是在寻找第三方解决方案,但是,我们使用了 WatiN 在自动化 UI 测试方面取得了巨大成功.

You said you're not looking for a third party solution, however, we have used WatiN in work with great success for automated UI testing.

它是开源的,所以如果你想看看他们是怎么做的,你可以.

It's open source, so if you want to see how they do it, you can.

这篇关于以编程方式与 IE 浏览器交互以填写表单和导航等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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