我正在尝试获取生成的网页内容,以便提取显示文本。我尝试了下面的代码,但它让我得到了源 html 而不是生成的 html。
string urlPath = "http://www.cbsnews.com/news/jamar-clark-protests-follow-decision-not-to-file-charges-in-minneapolis-police-shooting/";
WebClient client = new WebClient();
string str = client.DownloadString(urlPath);
将 str 变量中的文本与 Chrome 浏览器中开发者工具中的 html 进行比较,您会得到不同的结果。
任何建议将不胜感激。