简体   繁体   中英

C# Web Browser Instagram login page is not loading

I'm trying to login to instagram with c# webbrowser. But the login page is not loading. There is only a blank page.

By the way, my internet explorer opens the page.

private void Form1_Load(object sender, EventArgs e)
{
  webBrowser1.Navigate("https://instagram.com/accounts/login/");
}

This brings only a blank page. I think instagram find a way to block logins with webbrowser. What do you suggest?

These are the errors I'm getting while page loading.

unable to get property stringify of undefined or null reference object doesn't support this property or method replaceState

在此处输入图片说明在此处输入图片说明

well these are only some guesses so cannot be sure. if you can give more information such as error etc.

  1. first and most likely webbrowser does not support src="**//**domain.com" protocol. notice the url does not start with http or https as a work around try update it with http://domain.com
  2. some jquery is not supported it says 1.7 but might be some problem with webbrowser.
  3. AJAX requests are blocked by webbrowser.
  4. also if you realy think it is blocked by instagram try changing useragent header of the webBrowser

I suggest use ScriptErrorsSuppressed property and error handling event to get more information about the error (if there is one)

Edit: Good news is I am able to replicate your problem with IE11 (Document Mode = IE7) I got exactly same error with the SSs also tried IE8 it did not work either so you need to force WebBrowser control to emulate as IE9 at least and to do that you need the update some registry keys luckily there are two great SO answers for that. 1 2 also just saw this one as well

Give them a try and see what happens.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM