我想從網站中提取一些數據,但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