Avatar of RGuillermo
RGuillermo
Flag for United States of America

asked on 

downloading a webpage

Hello Experts
I am trying to download a webpage
and then programmatically clck on any button

AS an example I am using https://www.msn.com/en-us

My visual c# code is as follows

        private void button2_Click_1(object sender, EventArgs e)
        {
            string url = textBox_url.Text;
            WebClient webClient = new WebClient();
            webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
            webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
            webClient.DownloadFileAsync(new Uri(url), @"c:\tmp\aaaaaaa___myfile.txt");
        }

the problem is once I get the source code
I do not get the information of the lower part of the web page.
Like the small squares with additional news not as important as the main body

Why am I not getting the full code of the web page?
Are these js scripts that should be downloaded separately?
REgards,
Web DevelopmentC#JavaScript

Avatar of undefined
Last Comment
RGuillermo

8/22/2022 - Mon