We help IT Professionals succeed at work.
Get Started

downloading a webpage

RGuillermo
RGuillermo asked
on
83 Views
Last Modified: 2020-01-02
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,
Comment
Watch Question
Dr. KlahnPrincipal Software Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 3 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE