How to retrieve via C # the page HTML generated with AngularJS?

6

How to retrieve the HTML code of a page that uses AngularJS to process some information and generate a chart? I was able to easily retrieve the HTML code using WebRequest as demonstrated in the example below, but the content (graphic) generated by AngularJS does not come in the page code.

WebRequest request = WebRequest.Create("http://localhost:36789/minhaapp#/index");
WebResponse response = request.GetResponse();
Stream data = response.GetResponseStream();
string html = String.Empty;
using (StreamReader sr = new StreamReader(data))
{
    html = sr.ReadToEnd();
}
    
asked by anonymous 29.02.2016 / 15:08

1 answer

1

If you have permission to edit the site that generates the graph you must extract the graph data via JavaScript and send the data only through an http request to the server. It is not ideal to send html pro server to extract the data.

    
29.02.2016 / 17:48