Button click in web browser

后端 未结 2 1793
深忆病人
深忆病人 2021-01-14 09:22

I have created web browser, now i want to by clicking button1 on my form click the button on the web.

private void button1_Click(object sender, EventArgs e)
         


        
2条回答
  •  -上瘾入骨i
    2021-01-14 10:14

    Try Iterating over all of the elements in the webpage. When you find one with the value you want, you could click that element.

    foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("input")
    {
        if (el.GetAttribute("value").Equals("→"))
        {
            el.InvokeMember("click");
        }
    }
    

提交回复
热议问题