<分区>
如何在 C# 中从 WebView 组件获取 html 源代码?
<分区>
如何在 C# 中从 WebView 组件获取 html 源代码?
最佳答案
您可以使用 InvokeScript
或 InvokeScriptAsync
方法。请确保首先加载页面。
string html = await myWebView.InvokeScriptAsync("eval", new string[] { "document.documentElement.outerHTML;" });
var text = html;
关于C# Windows App 如何从 WebView 获取 html 源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36920560/