以yahoo台灣為例

click  

1、<input class="plong inputtext" type="text" id="p" name="p" accesskey="s" autocomplete="off">

2、<input type="submit" id="searchsubmit" class="srchbtn" value="網頁搜尋">

取得2個物件的ID值後,可進行填值與送出

private void button1_Click(object sender, EventArgs e)
{


webBrowser1.Document.GetElementById("p").SetAttribute("value","test");
webBrowser1.Document.GetElementById("searchsubmit").InvokeMember("click");

 

}

arrow
arrow
    文章標籤
    C# webBrowser
    全站熱搜

    mming 發表在 痞客邦 留言(1) 人氣()