我想从网站中提取一些数据,但submitbutton只调用第一次在文档中完成event.after加载第一次提交的页面文档完成事件不执行 我的代码是网页浏览器控制c#只调用下次第一次不工作
private void b_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
WebBrowser b = sender as WebBrowser;
string response = "";
response = b.DocumentText;
HtmlElement links = b.Document.GetElementById("btn1");
links.InvokeMember("click");
checkTrafiicButtonClick = true;
MessageBox.Show("");
***// upto these working and loading second page after that i want to fill data
and want to submit but down line is not working and it should be work after
loading the page that i submitted how can i do these***
HtmlElement tfrno = b.Document.GetElementById("TrfNo");
tfrno.SetAttribute("value", "50012079");
HtmlElement submitButon = b.Document.GetElementById("submitBttn");
submitButon.InvokeMember("click");
}
不BTN1点击加载新一页? – VladL 2013-02-13 12:06:28
是第一页btn1点击执行和第二页loadig,但我想填写第二页的输入框,并要提交 – dfgv 2013-02-13 12:10:50
只需添加一个变量,以跟踪你的网页。 – 2013-02-13 13:20:23