Zlatan
Zlatan

Reputation: 698

Create a html document from result of webclient downloadstring method

I want to get html content from a webpage in my windows app. Im using webclient DownloadString method to get the string content and now I want to store this string result in html document but I am unable to do this.

Upvotes: 0

Views: 1241

Answers (2)

Oded
Oded

Reputation: 499062

I suggest using the HTML Agility Pack to download and parse the HTML you are interested in.

It offers several ways to query the HTML, including LINQ and XPath.

Upvotes: 1

Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

You just need to do:

System.IO.File.WriteAllText("youFileName.html",yourString);

Upvotes: 0

Related Questions