There is html from which I want to get information. I use HtmlAgilityPack

<div class="more__2VudS more__30Xud"> <div class="time__RkgeO time__4mUXN"> 01 Января 2018 в 17:03 </div> 

I wanted to get everything that is contained in the time class, but the result does not find information. There is a suspicion that incorrectly specified filter for contains

  var platform = ss[i].SelectSingleNode("//div[contains(@class, 'time__')]").InnerText; 
  • I certainly do not agitate you to abandon the htmlagilitypack. But I recommend to look at AngelSharp, there you can do operations on the DOM but at the same time not by its own syntax but according to w3c standards. The library is developed and constantly evolving. - Dmitry Polyanin
  • And on such a query you could use the div[class^="time"] - Dmitry Polyanin

1 answer 1

Still, I'll write as an answer if you decide to use AngleSharp .

Its advantage is that it is fully compatible and supports modern browser standards. And in it, finding the right node will be very simple.

 // создаём парсер var parser = new HtmlParser(); // наш докумен var source = "<h1>Заголовок</h1> <div class=\"times__34232545\">some value</div>"; // парсим var document = parser.Parse(source); // достаём нужный элемент var el = document.QuerySelector("div[class^=\"time\"]"); 

This is, of course, just a sample code, for your situation you will need to make the necessary adaptation

note that we use standard javascript / CSS syntax - https://www.w3schools.com/CSSref/sel_attr_begin.asp

Site parser library - https://anglesharp.imtqy.com/
And the documentation itself is https://github.com/AngleSharp/AngleSharp/wiki/Documentation