如何在Windows Phone 8.1中获取WebView控件的HTML文本 [英] How to get the HTML text for a WebView control in Windows Phone 8.1
本文介绍了如何在Windows Phone 8.1中获取WebView控件的HTML文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在Windows Phone 8.1中获取WebView控件的HTML文本,就像我们在WebBrowser控件中获得相同的内容,如下所示:
Is there a way to get the HTML text for a WebView control in Windows Phone 8.1 like we get the same for WebBrowser control as below:
webBrowser1.DocumentText
谢谢,
Thanks,
推荐答案
您可以尝试 HtmlAgilityPack [ ^ ]。然后,HTML可以通过Linq查询,例如:
You can try HtmlAgilityPack[^]. The HTML then becomes queryable through Linq Like:
HtmlDocument htmlDoc = webBrowser1.Document as HtmlDocument;
string innerText = htmlDoc.DocumentNode.Descendants("body").Single().InnerText;
你也可以加载HTML作为字符串或流通过 LoadHtml
和分别加载
这篇关于如何在Windows Phone 8.1中获取WebView控件的HTML文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文