安装NuGet包 HtmlAgilityPack
var wc = new WebClient();
wc.Encoding = Encoding.GetEncoding("UTF-8"); //转格式
var html = wc.DownloadString(url); //获取内容
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(html);
HtmlNode nodeinfo = doc.GetElementbyId("content");//获取该id内容
string htmlstr = nodeinfo.OuterHtml;