Logowanie na strone bez (ID)

0

Witam, pomoże ktoś edytować jak podpiąć 2 TextBoxy loginu i hasła pod ten button logowania?

Login:

<input type="email" name="email" placeholder="Email" class="email" tabindex="1">

Hasło:

<input type="password" name="password" placeholder="Password" class="password" tabindex="2">
 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://...")
    End Sub
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim allElements As HtmlElementCollection = WebBrowser1.Document.All
        For Each webpageElement As HtmlElement In allElements
            'value="Login"
            If webpageElement.GetAttribute("value") = "Login" Then
                webpageElement.InvokeMember("click")
            End If
        Next
End Sub
0

Tak to powinno ogólnie wyglądać:

WebBrowser1.Navigate("http://asd.asd")

'Tutaj powinno być odczekanie aż strona się załaduje

Dim elementsByTagName As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")

Dim htmlElementCollection As HtmlElementCollection = elementsByTagName.GetElementsByName("email")
For Each o As HtmlElement In htmlElementCollection
    o.InnerText = "[email protected]"
Next

htmlElementCollection = elementsByTagName.GetElementsByName("password")
For Each o As HtmlElement In htmlElementCollection
    o.InnerText = "sample password"
Next

For Each o As HtmlElement In elementsByTagName
    If o.GetAttribute("value") = "Login" Then
        o.InvokeMember("click")
    End If
Next

1 użytkowników online, w tym zalogowanych: 0, gości: 1