c# 从 url 获取 js 加载的内容

c# get content loaded by js from url

我想从这个 url 得到 table 但内容按 javascript 加载。 我下载 HTML 这样的字符串

WebClient wc = new WebClient();
var html = wc.DownloadString("https://www.bloomberg.com/markets/currencies");

如何获取 javascript 加载的内容??

WebClient 和 DownloadString 只会将页面内容下载为字符串,为了能够 运行 此页面上的 JavaScript 代码,您需要一个理解 DOM 并且可以 运行 JavaScript,这将是一个浏览器。

有关此主题的更多信息:
Running Scripts in HtmlAgilityPack
Load a DOM and Execute javascript, server side, with .Net