c# How to save htmlagilitypack node to string issue ?

  • Thread starter Thread starter elfenliedtopfan2
  • Start date Start date
E

elfenliedtopfan2

Guest
ok i have working code that does exactly what i want it to do bar one thing i need to convert the node to string and save out and i cant seem to understand how to do this code below.


public void testfunc()
{

var url = "Steyr AUG A3 - 3D model by krovash (@krovash)";

using (HttpClient client = new HttpClient())
{
using (HttpResponseMessage response = client.GetAsync(url).Result)
{
using (HttpContent content = response.Content)
{
string result = content.ReadAsStringAsync().Result;
System.IO.File.WriteAllText(Application.StartupPath + "rip.html", result);
}
}
}


var path = Application.StartupPath + "rip.html";

var doc = new HtmlAgilityPack.HtmlDocument();
doc.Load(path);

var node = doc.DocumentNode.SelectNodes("//*[@id=\"js-dom-data-prefetched-data\"]");
}


but as its a node its not converting i tryed the node.tostring() but comes up with htmlagilitypack and dont show the text.

Continue reading...
 
Back
Top