网页浏览器或华廷内捕捉用户活动 [英] catch user activity within webbrowser or watin

查看:160
本文介绍了网页浏览器或华廷内捕捉用户活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法来检测范围内的所有可能的用户活动 web浏览器并返回一个自定义的事件 ?例如:用户点击搜索按钮,返回SearchButtonClicked定制的事件

Is there any way to detect all the possible user activities within a WebBrowser and return a custom Event? For example: User clicks on "search" button, return "SearchButtonClicked" custom Event.

这会是这样的,记录所有用户执行活动的,存储在一个序列,一旦他希望可以自动化。

It would be something like, logging of all the activity that user does, stored in a sequence and could be automated once he wanted.

编辑:我没有自己的网页。我试图让一个应用程序来自动对谷歌一些搜索。

I do not own the webpage. I am trying to make an application to automate some searching on google.

推荐答案

经过一番研究,我发现了 HtmlElementEventHandler

After some research, I discovered the HtmlElementEventHandler.

例如:

webBrowser1.Document.GetElementById("MainContent_LoginButton").Click += new HtmlElementEventHandler(test);

// some code...

public void test(object sender, HtmlElementEventArgs e)
{
    MessageBox.Show("Clicked login button");
}

这篇关于网页浏览器或华廷内捕捉用户活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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