I'm trying to get this element from part of a html page. Below is the snippet of html code from the webpage html:
Код: Выделить всё
7,646.16
Код: Выделить всё
using (WebClient client = new WebClient())
{
string html = client.DownloadString(url);
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(html);
try
{
IEnumerable nodes = htmlDoc.DocumentNode.Descendants().Where(n => n.HasClass("datatable_cell__LJp3C datatable_cell--align-end__qgxDQ datatable_cell--up__hIuZF min-w-[77px] text-right align-middle text-sm font-normal leading-5 rtl:text-right text-positive-main"));
try
{
foreach (var node in nodes)
{
Console.WriteLine(node);
}
}
catch
{
Console.WriteLine("Failed Process");
}
}
}
Источник: https://stackoverflow.com/questions/781 ... gilitypack