如何像浏览器一样在 C# 控制台中加载网站?

how to load a website in c# console exactly like a webbrowser?

我想从控制台获取网站元素值以提高抓取速度。我不能使用 DownloadString() 因为该网站应该只在浏览器中加载以显示数据。我试过 DownloadString() 但始终在浏览器中显示的网站主要数据不包括在内。当我在控制台对象 (Webbrowser wb = new Webbrowser ) 中使用 Webbrowser 时也会发生,但在 windowsForm 中使用 Webbrowser 时我没有任何问题。 非常感谢。

也许 AngelSharp 可以为您提供帮助:https://anglesharp.github.io/docs/Examples.html