ivan
ivan

Reputation: 91

download html page with all it content

Can I download some html page with all it content (images,scripts .. etc) as list of files or single web archive?This gives me only markup:

      using (WebClient client = new WebClient())
        {
            client.DownloadFile("http://www.youtube.com", @"D:\anyfile.html");
          //or
            string htmlCode = client.DownloadString("http://www.yotube.com");
          // save htmlcode ...
        }

May be there are any API?

Upvotes: 1

Views: 303

Answers (1)

Jonathan Wood
Jonathan Wood

Reputation: 67203

Yes, it will only give you markup because that's all that's returned from the URL you provided.

In order to access all the other referenced resources, you'll need to do some parsing of the markup and get the URLs for those resources.

Upvotes: 1

Related Questions