Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello Problems in internet explorer Does not click the login button I do not know where error this code

VB
Dim web As Object
        web = CreateObject("InternetExplorer.Application")

        web.Navigate("www.facebook.com") 

   
   web.Visible = True

Threading.Thread.Sleep(5000)
web.Document.GetElementById("submit").InvokeMember("click")



I do not want to use the performance webbrowser And I do not want to use sendkey
I want to use the code in question and deal with it and how do I access by clicking on the button
Posted
Comments
[no name] 26-Jun-14 13:06pm    
Either you are not allowing the document to load or there is no button with an ID of "submit" on that page.
Sergey Alexandrovich Kryukov 26-Jun-14 13:40pm    
Your guess turned out to be correct: there is no such id, I just checked up and posted some answer with some advice (I wish I knew the purpose of doing all that)...
—SA

I just checked up http:\\www.facebook.com: there is not a button with id="submit".

And the whole approach seems bad, looks like an abuse. What if IE is not installed? Depending on what you need, you could 1) create a UI application using the WebControl control, or 2) without any UI, use HttpWebRequest. But why doing all that?

—SA
 
Share this answer
 
you can try below code

C#
Dim web As Object
        web = CreateObject("InternetExplorer.Application")
 
        web.Navigate("www.facebook.com") 
 
   
   web.Visible = True
 
Threading.Thread.Sleep(5000)
web.Document.GetElementById("loginbutton").InvokeMember("click")


it might work for you

Thanks
Gaurav Dhol
Skype: dhol.gaurav
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900