0

Hello I'm trying to simulate a browser and this specific URL is not working well:

https://www.btgpactualdigital.com/fundos-de-investimento/spx-nimitz-fic-fim-access

It returns always the same response code... I'm using for test purpose this simple code:

 using (var client = new WebClient())
            {

                client.Headers[HttpRequestHeader.UserAgent] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0";
                client.Headers[HttpRequestHeader.Accept] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
                client.Headers[HttpRequestHeader.AcceptLanguage] = "en-us,en;q=0.5";                    
                var responseStream = new GZipStream(client.OpenRead(url), CompressionMode.Decompress);
                var reader = new StreamReader(responseStream);
                textResponse = reader.ReadToEnd();                
            }

But it is always returning a different code from I can see on browser... I got all Headers from browser to try simulate same scenario.

Any suggestion ? Thanks !

Catao
  • 131
  • 2
  • 4
  • 10
  • You need to tell us what you were expecting and what you actually got or we cant help you. –  Jan 17 '20 at 20:11
  • It looks like it is an angular site. That means javascript is rendering the page. Yuo are getting the correct response, but not the rendered html. – Anil Goel Jan 17 '20 at 20:21
  • Good point @AnilGoel ! Is it possible to get this rendered html ? – Catao Jan 17 '20 at 20:26
  • Look at this link for a possible solution https://stackoverflow.com/questions/7333973/how-to-get-rendered-html-processed-by-javascript-in-webbrowser-control – Anil Goel Jan 18 '20 at 23:13

0 Answers0