0

Hello i making HttpWebRequest/response to This WebSite

and when i reading the response it is empty because it have execute JavaScript code inside i try HttpWebRequest/response

 HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("https://www.bbvanetcash.com/local_kyop/KYOPSolicitarCredenciales.html");

                    myHttpWebRequest.Method = WebRequestMethods.Http.Get;
                    myHttpWebRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)";//"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0";

                    myHttpWebRequest.ProtocolVersion = HttpVersion.Version11;
                    myHttpWebRequest.AllowAutoRedirect = true;
                    myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
                    myHttpWebRequest.CookieContainer = new CookieContainer();

                    HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
                    Stream streamResponseLogin = myHttpWebResponse.GetResponseStream();
                    StreamReader streamReadLogin = new StreamReader(streamResponseLogin);
                    LoginInfo = streamReadLogin.ReadToEnd();//here data is empty only 1 element

Then i readed about WebBrowser and i try this

  WebBrowser wb = new WebBrowser();
            wb.ScrollBarsEnabled = false;
            wb.ScriptErrorsSuppressed = true;
            wb.AllowNavigation = true;

            wb.Navigate("https://www.bbvanetcash.com/local_kyop/KYOPSolicitarCredenciales.html");
            while (wb.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); }
            wb.Document.DomDocument.ToString();
            string form = wb.DocumentText.ToString();

and i get the same things, i can't get the full thml page. Any ideas?

Vladimir Potapov
  • 2,347
  • 7
  • 44
  • 71

0 Answers0