C#: How to login to Twitter through webbrowser?

kytro360

Power Member
Joined
Jan 12, 2010
Messages
708
Reaction score
737
Hello, does anyone have some working code to login to Twitter with the webbrowser in C#?

I have some code that should work, I have the right ID's and everything (I used Firebug) but when I start my code nothing happens.

If you guys can help it would be awesome!

Its funny I can code it to login in through httpwebrequests but Twitter doesnt want to work with the webbrowser :/
 
Well, i started learning C# today so i don't know if this will help you, but when i coded twitter bot in python, i've always accessed mobile version of twitter because it is a lot easier to automate. I've tried now to login mobile version using C# with success.

Code:
webBrowser1.Navigate("https://mobile.twitter.com/session/new");
webBrowser1.Document.All["username"].SetAttribute("value","username");
webBrowser1.Document.All["password"].SetAttribute("value","password");
webBrowser1.Document.GetElementById("signupbutton").InvokeMember("click");
 
Back
Top