How programmatically submit a form without a submit button in WebBrowser

孤街浪徒 提交于 2019-11-26 21:20:34

问题


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:


Try this (or something like it):

HtmlElementCollection elements = this.webBrowserControl.Document.GetElementsByTagName("Form");  

foreach(HtmlElement currentElement in elements)
{
    currentElement.InvokeMember("submit");
}


来源:https://stackoverflow.com/questions/1539685/how-programmatically-submit-a-form-without-a-submit-button-in-webbrowser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!