0
我有這種形式的一些HTML:上Xamarin後裔HTML敏捷性包不工作
"\r
<p>One<\/p>\r
<p>Two<\/p>"
"\r
<p>Three<\/p>\r
<p>Four<\/p>"
它有這樣的,因爲我消費web服務,所以我不能改變的內容。我的問題是,當我嘗試獲取節點的innerText
,然後將它傳遞給TextView時,它什麼也不做。我的代碼有問題嗎? Xamarin不允許使用SelectSingleNode
作爲HTML敏捷性軟件包。這是我到目前爲止有:
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(HTMLstring);
foreach (HtmlNode node in doc.DocumentNode.Descendants("p"))
{
string currentText = node.InnerText; //Fetching the InnerText of the node
Console.WriteLine(currentText); // Testing if prints (It doesn't)
}