How programmatically submit a form without a submit button in WebBrowser

前端 未结 1 1919
情话喂你
情话喂你 2020-12-06 07:07

I navigated to a website with a form that has no submit button but does have form. I would like to submit this form. How to do this using C# and WebBrowser control?

相关标签:
1条回答
  • 2020-12-06 07:27

    Try this (or something like it):

    HtmlElementCollection elements = this.webBrowserControl.Document.GetElementsByTagName("Form");  
    
    foreach(HtmlElement currentElement in elements)
    {
        currentElement.InvokeMember("submit");
    }
    
    0 讨论(0)
提交回复
热议问题