0
노드 사이에서 텍스트를 추출하는 데 문제가 있습니다. 전체 노드 span
을 보여줍니다. 예 : 4 : 45, 5 : 15 e.t.c와 같은 시간 값을 얻고 싶습니다.노드간에 텍스트를 가져 오는 방법
var html = @"https://programtv.onet.pl/";
HtmlWeb web = new HtmlWeb();
var htmldoc=web.Load(html);
var findhours = htmldoc.DocumentNode.SelectNodes("//div[@id='boxTV1']//div[@class='hours']//span[@class='hour']");
if (findhours != null)
{
foreach (var x in findhours)
{
Console.WriteLine(x.OuterHtml);
}
}
else
{
Console.WriteLine("node = null");
}
Console.ReadLine();