public static void Main(string[] args)
var url = "https://www.politie.nl/nieuws/2019/november/15/09-operatie-alfa---grote-vangst-op-kamp-verdachten-langer-vast.html";
var htmlDoc = web.Load(url);
var content = htmlDoc.DocumentNode.Descendants(0)
.FirstOrDefault(n => n.HasClass("content-blocks")).InnerText;
var headings = htmlDoc.DocumentNode.SelectNodes("//h2");
var subheadings = htmlDoc.DocumentNode.SelectNodes("//strong");
WriteCollection(headings, "Headings");
WriteCollection(subheadings, "SubHeadings");
var image = htmlDoc.DocumentNode.Descendants(0).FirstOrDefault(n => n.HasClass("nieuwsafbeelding")) ?? htmlDoc.DocumentNode.Descendants(0).FirstOrDefault(n => n.HasClass("opsporing-image"));
var imageSrc = image.SelectNodes("//img").FirstOrDefault(n => n.Attributes["src"].Value.Contains("/binaries")).GetAttributeValue("src", null).ToString();
Console.WriteLine("Image found: https://politie.nl " +imageSrc);
Console.WriteLine("-----------------");
Console.WriteLine("-----------------");
Console.WriteLine("...::[CONTENT]::..");
Console.WriteLine(content.Trim());
public static void WriteCollection (HtmlNodeCollection nodeCollection, string name)
if (nodeCollection != null)
Console.WriteLine(String.Format("..::FOUND {0} [{1}] on this page::..", nodeCollection.Count, name.ToUpper()));
Console.WriteLine("-------------------------------------");
foreach (var node in nodeCollection)
Console.WriteLine(String.Format("> {0}", node.InnerText));
Console.WriteLine("-----------------");
Console.WriteLine("..::[{0}]::..", name);
Console.WriteLine("> none found");
Console.WriteLine("-----------------");