VB net how to log into a site by form

0

I'm trying to log into a website with a program here that I did in vsiual studio 2012 with a code that I found, but it's not going to cause the lack of ID

Code:

Private Sub BtnIrPara_Click(sender As Object, e As EventArgs) Handles btnIrPara.Click
        WebBrowser1.Navigate("https://site")
End Sub


Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
        Try
            WebBrowser1.Document.GetElementById("username").SetAttribute("value", txtUsuario.Text)
            WebBrowser1.Document.GetElementById("passwd").SetAttribute("value", txtSenha.Text)
            WebBrowser1.Document.GetElementById("signin").InvokeMember("click")
        Catch ex As Exception
            MessageBox.Show("Erro : " + ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
End Sub

Data:

Text Box for User

<input id="username" class="cookie-username" type="text" name="username" placeholder="nome de usuário" required="" value="">

Text Box for Password

<input id="passwd" type="password" name="pwd" placeholder="password" required="">

Submit button

<button class="btn-sign-in" type="submit" value="SIGN IN">SIGN IN</button>
    
asked by anonymous 15.03.2018 / 22:05

0 answers