使用C#在html页面中自动化 [英] Automation in html page using C#
本文介绍了使用C#在html页面中自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想知道如何将值插入html页面的文本框中并使用C#单击按钮?单击按钮后,我将被重定向到另一个页面,需要在该页面上将新页面上的值存储到文本文件中.我需要重复很多次.
Hi Guys,
I would like to know how I could insert values into text boxes in a html page and click a button using C#? Once I click the button I would be redirected to another page where I need to store the values on the new page into a text file. I need to repeat this process a lot of times.
Thanks!!
推荐答案
wbrowser
是Web浏览器控件,您需要在其中导航到所需页面.
wbrowser
is the web browser control where you need to navigate to the required page.
HtmlElement obj;
obj = wbrowser.Document.GetElementById("fill_textbox");
obj.SetAttribute("value", "This is the content")
obj = wbrowser.Document.GetElementById("submit_button");
obj.InvokeMember("Click");
这篇关于使用C#在html页面中自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文