using var client = new HttpClient();
var doc = new HtmlDocument();
doc.LoadHtml(await client.GetStringAsync("https://www.example.com/"));
foreach (var e in doc.DocumentNode.QuerySelectorAll(":only-child"))
Console.WriteLine(e.Name);
It finds only 2 elements:
div
a
whereas using document.querySelectorAll(':only-child') in Chrome finds html in addition to the above two.
Code to reproduce (using version 1.2):
It finds only 2 elements:
whereas using
document.querySelectorAll(':only-child')
in Chrome findshtml
in addition to the above two.