CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2012
    Posts
    7

    GetElementById help

    Im attempting to make a Facebook app, but i cant seem to find the name to the status update box and the post button, if someone could help me that would be great. this is what i have so far. i do have the name to the [CODE]WebBrowser1.Document.GetElementById("xhpc_message_text").SetAttribute("value", KryptonRichTextBox1.Text)[CODE] but it some reason wont work. im coding in visual studio.

    Code:
    Public Class Form11
    
        Private Sub KryptonButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton1.Click
            WebBrowser1.Document.GetElementById("email").SetAttribute("value", KryptonTextBox1.Text)
            WebBrowser1.Document.GetElementById("pass").SetAttribute("value", KryptonTextBox2.Text)
    
            WebBrowser1.Document.GetElementById("loginbutton").InvokeMember("click")
        End Sub
    
        Private Sub KryptonButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton2.Click
            WebBrowser1.Document.GetElementById("").SetAttribute("value", KryptonRichTextBox1.Text)
            WebBrowser1.Document.GetElementById("").InvokeMember("click")
        End Sub
    End Class

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: GetElementById help

    Your way will not work; not without the correct permissions - which you don't have - to access the facebook "controls"

    You will need to make use of Facebook's GraphAPI. ALL Facebook apps make use of the GraphAPI.

    Have a look at this article I wrote to help you get started :

    Creating a Desktop Application for Facebook, using the GraphAPI and VB.NET
    http://www.codeguru.com/vb/gen/article.php/c19071/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured