Visual Basic 2010: Problem with WebSite Login

11/06/2012 20:34 24terminetor96#1
Hi! I have created one program with this code for website login:
Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://www.facebook.com")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser1.Document.GetElementById("email").SetAttribute("value", TextBox1.Text)
        WebBrowser1.Document.GetElementById("pass").SetAttribute("value", TextBox2.Text)
        WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
    End Sub

End Class
I take the element for password and username with Horme and i found name="username" and name="password" for the 2 input of enter login datas, but when i try with the button (Access) i don't found the name...how can i found it?
11/06/2012 22:00 tolio#2
you have to submit the form
11/06/2012 22:15 24terminetor96#3
How?
11/06/2012 22:24 boxxiebabee#4
Quote:
Originally Posted by tolio View Post
you have to submit the form
Macht er ja :>

@TE: You will need the ID, not the name from the inputs / button.
11/06/2012 22:45 24terminetor96#5
Ehm...for input text of username and password i use the name and not give an error...in 90 % forum/site there aren't id or name and in one forum i try with button id but it give me an error in the line
11/07/2012 08:54 boxxiebabee#6
Quote:
Originally Posted by 24terminetor96 View Post
Ehm...for input text of username and password i use the name and not give an error...in 90 % forum/site there aren't id or name and in one forum i try with button id but it give me an error in the line
GetElementById, do you know what that mean? BY ID, not BY NAME.
11/07/2012 10:52 dakata783#7
better use httpwebrequest it's faster and you can create many cookie containers
11/07/2012 13:38 24terminetor96#8
Quote:
Originally Posted by boxxiebabee View Post
GetElementById, do you know what that mean? BY ID, not BY NAME.
No...In all site and forum for username and password i take the name= and it not give me an error. For button in same forum/site there is the name and if i take it the program works...but if i take for exemple of this forum the id it give me an error (and in same there isn't the id)...
11/08/2012 23:32 24terminetor96#9
Ehy anyone can help me? I Don't know how to resolve this problem...
11/09/2012 06:42 boxxiebabee#10
without the sourcecode from the website, no.
11/09/2012 08:41 Der Anbieter#11
Quote:
Originally Posted by boxxiebabee View Post
without the sourcecode from the website, no.
If you'd take a closer look you'd notice that it's facebook.com ;)
11/09/2012 08:50 boxxiebabee#12
Quote:
Originally Posted by Der Anbieter View Post
If you'd take a closer look you'd notice that it's facebook.com ;)
Oh, ok... :p

So.. I told you that you will need the fucking ID... the username & password only works because the ID is the same.. you will need the ID from the button >.>...

tip: the id from the button always change...
11/09/2012 09:08 Der Anbieter#13
Quote:
Originally Posted by boxxiebabee View Post
Oh, ok... :p

So.. I told you that you will need the fucking ID... the username & password only works because the ID is the same.. you will need the ID from the button >.>...

tip: the id from the button always change...
Damn, i just wrote that and then u responded :|
11/09/2012 15:36 24terminetor96#14
Ehm sorry the source code is:
Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://www.google.it")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser1.Document.GetElementById("username").SetAttribute("value", TextBox1.Text)
        WebBrowser1.Document.GetElementById("password").SetAttribute("value", TextBox2.Text)
        WebBrowser1.Document.GetElementById("submit").InvokeMember("click")

    End Sub

End Class
And the problem is that i don't found the name of the input (button)
11/09/2012 18:11 boxxiebabee#15
Quote:
Originally Posted by 24terminetor96 View Post
Ehm sorry the source code is:
Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://www.google.it")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser1.Document.GetElementById("username").SetAttribute("value", TextBox1.Text)
        WebBrowser1.Document.GetElementById("password").SetAttribute("value", TextBox2.Text)
        WebBrowser1.Document.GetElementById("submit").InvokeMember("click")

    End Sub

End Class
And the problem is that i don't found the name of the input (button)
Are you fucking stupid?! You need the ID and not the name.