This is my code:
var html = webBrowser1.DocumentText;
HtmlWeb web = new HtmlWeb();
var htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.LoadHtml(html);
var node = htmlDoc.DocumentNode.SelectSingleNode("/html/body/div/div/div/div/section/section/div/div/div/div").Attributes["class"].Value;
Console.WriteLine("Node Name: " + node);
So far everything works fine, but if I add a "/ div" to "SelectSingleNode" then it won't work (error message: "Exception thrown:" System.NullReferenceException ""), although there is another "div" in the HTML code there.
I think it is because in the HTML code before the next "div" there is a ":: before", but only if i analyze it in the browser
A part of the HTML code:
<div class="un-page__body">
<div class="container-fluid">
::before
<div class="row">
::before
<div class="col-sm-6">