VB.NET - Click Submit Button on Webbrowser page

前端 未结 8 681
时光说笑
时光说笑 2021-02-09 02:30

I have a html page open on my webbrowser object, I can enter username and password okay, but I\'m stuck and don\'t know how to submit the info. Here is the html code for the us

8条回答
  •  你的背包
    2021-02-09 02:59

      Private Sub bt_continue_Click(sender As Object, e As EventArgs) Handles bt_continue.Click
        wb_apple.Document.GetElementById("phoneNumber").Focus()
        wb_apple.Document.GetElementById("phoneNumber").InnerText = tb_phonenumber.Text
        wb_apple.Document.GetElementById("reservationCode").Focus()
        wb_apple.Document.GetElementById("reservationCode").InnerText = tb_regcode.Text
        'SendKeys.Send("{Tab}{Tab}{Tab}")
        'For Each Element As HtmlElement In wb_apple.Document.GetElementsByTagName("a")
        'If Element.OuterHtml.Contains("iReserve.sms.submitButtonLabel") Then
        'Element.InvokeMember("click")
        'Exit For
        ' End If
        'Next Element
        wb_apple.Document.GetElementById("smsPageForm").Focus()
        wb_apple.Document.GetElementById("smsPageForm").InvokeMember("submit")
    
    End Sub
    

提交回复
热议问题