0

I am new to the programming and I have one concern when I am trying to read my html page content. I am not getting complete data but when I am saving the page with right click save as option I get complete data. NOTE: and inspect element also I am not able to see all data(I am able to see what I read using c#)

How can I read complete data using programming? Please help me to overcome this and following is my code:

private void button1_Click(object sender, EventArgs e)
    {
        string urlAddress = "http://iris-rmds.tomtomgroup.com

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();

        if (response.StatusCode == HttpStatusCode.OK)
        {
            Stream receiveStream = response.GetResponseStream();
            StreamReader readStream = null;

            if (response.CharacterSet == null)
            {
                readStream = new StreamReader(receiveStream);
            }
            else
            {
                readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));
            }

            string data = readStream.ReadToEnd();
            textBox1.Text  = data;
            MessageBox.Show(data.ToString());
            //var msg = "Hello world!";
            //MessageBox.Show(msg);
            Clipboard.SetText(data);
            response.Close();
            readStream.Close();

        }
    }
Alex
  • 4,885
  • 3
  • 19
  • 39

1 Answers1

0

Maybe your page is using JavaScript that will not be loaded completely at the beginning. This type of page is like Facebook or Twitter that will dynamically loading its content. By right click and save as, the content is already exist or loaded completely.

Maybe you can save it using method in the answer of the other question: "Scraping webpage generated by javascript with C#".

Yohanes Nurcahyo
  • 601
  • 8
  • 19