【发布时间】:2015-11-30 20:06:30
【问题描述】:
我正在尝试用 c# 自动填充网站的文本框,我使用了:
private void button1_Click(object sender, EventArgs e)
{
System.Windows.Forms.WebBrowser webBrowser = new WebBrowser();
HtmlDocument document = null;
document=webBrowser.Document;
System.Diagnostics.Process.Start("http://www.google.co.in");
document.GetElementById("lst-ib").SetAttribute("value", "ss");
}
网页正在打开,但文本框未填充指定值。我也尝试过内部文本而不是 setAttribute。我正在使用 Windows 窗体。
【问题讨论】:
-
你要做什么,打开一个网站,填写一个或多个输入值的值
-
@lordkain 是的,这正是我想做的。
-
您想打开浏览器,还是将结果保存到文件中?或者别的什么
标签: c# web automation