using AngleSharp.Parser.Html;
using AngleSharp.Scripting.JavaScript.Services;
using System.Collections.Generic;
using System.Threading.Tasks;
using Jint.Runtime.Environments;
using AngleSharp.Services.Scripting;
using AngleSharp.Scripting.JavaScript.Dom;
public static void Main()
var config = Configuration.Default.WithJavaScript().WithCss();
var parser = new HtmlParser(config);
var source = @"<!doctype html><html><body><div id='test'>content</div></body>";
var document = parser.Parse(source);
var jsService = config.Services.OfType<JavaScriptProvider>().FirstOrDefault(x => x.Engine.Type == "text/javascript");
var jintEngine = jsService.Engine.GetOrCreateJint(document);
var result = jintEngine.Execute("document.querySelectorAll('#test').innerHTML").GetCompletionValue();
Console.WriteLine(result);