2013-07-14 2 views
0

vb.net 애플리케이션을 개발 중입니다. webbrowser가 있는데 webform에 정보를 입력하고 Submit 버튼을 클릭해야합니다. 제출을 제외하고 모두 괜찮습니다, 아무 일도 일어나지 않습니다 !!! 도와주세요 !도와주세요 : VB.NET (WEbBrowser)에서 제출 버튼을 클릭하십시오.

HTML 페이지 :

<p> 
     <input id="submit" name="submit" type="submit" value="Publicar" /> 

</p> 

내 코드 :

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted 
    If PAgina = 0 Then 
     Dim document As HtmlDocument = WebBrowser1.Document 
     Dim inputValue As HtmlElement = document.GetElementById("title") 
     inputValue.SetAttribute("value", "sdf fdd fh fgh fgh fg hfg hf ghfgh fg fg f hf fgh ") 

     inputValue = document.GetElementById("zone") 
     inputValue.SetAttribute("value", "Logroño") 

     inputValue = document.GetElementById("editor") 
     inputValue.SetAttribute("value", "Logroño s dfs dfs fsdfsd fsddfg dfg df gdf gdf gd df sd sd fsd fsdfsdfsdsdfsdf sdsdf") 


     inputValue = document.GetElementById("email") 
     inputValue.SetAttribute("value", "[email protected]") 


     WebBrowser1.AllowNavigation = True 

     **Dim submitButton As HtmlElement = document.GetElementById("submit") 
     submitButton.InvokeMember("submit") 
     ' WebBrowser1.Document.Forms("post").InvokeMember("submit")** 
     PAgina = 1 
    End If 

최종 하위

답변

2

.InvokeMember("click") ; // instead of "submit" ? 

또는 이전에 제출 몇 초 지연을 추가하려고 시도합니다.

관련 문제