在自动输入文本网站的文本框,然后点击提交按钮,从C#? [英] Automate entering text in to website textbox and clicking submit button, from C#?

查看:450
本文介绍了在自动输入文本网站的文本框,然后点击提交按钮,从C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我们有一个通用的网站:google.com

Say we have a generic website: google.com

有没有一种方法,从C#我可以创建一个IE实例,到谷歌搜索文本框中输入文字(这只是一个例子,强调的是一个名为HTML文本框),并自动点击搜索按钮(再一个例子,强调的是任何指定的按钮)?

Is there a way, from C# I can create an instance of internet explorer, enter text in to the google search textbox (this is just an example, the emphasis is on a named HTML textbox) and automate clicking the search button (again an example, the emphasis is on any named button)?

我AP preciate Javascript是通常更适合于这种类型的东西,但有可能从C#这样做吗?我认识一个Internet Explorer实例可以在.NET创建,但我不能确定,如果你能负荷的网页,然后操纵从C#应用程序的网页

I appreciate Javascript is usually more appropriate for this type of stuff, but is it possible to do this from C#? I know an Internet Explorer instance can be created in .net, but I am unsure if you can "load" a webpage and then manipulate the webpage from a C# application

推荐答案

看看可以得到的NuGet一个.NET版本。它通常用于自动化浏览器测试。

Take a look at Selenium you can get a .Net version from NuGet. It's commonly used for automating browser testing.

这篇关于在自动输入文本网站的文本框,然后点击提交按钮,从C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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