Finding and clicking a button with no ID within html code in WebBrowser

后端 未结 2 1469
无人及你
无人及你 2021-01-05 22:14

I basically have a web-browser control that is going through and automatically completing some forms, it\'s been a breeze so far, however I\'ve gotten to a form that does no

2条回答
  •  无人及你
    2021-01-05 22:50

    
    
    
    
    
    HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");  
    foreach (HtmlElement el in elc)  
    {  
       if (el.GetAttribute("type").Equals("submit"))  
       {  
            el.InvokeMember("click");  
       }  
     }
    

提交回复
热议问题