我在阿拉伯语页面上尝试过这段代码:
tmlWeb hw = new HtmlWeb();
HtmlAgilityPack.HtmlDocument htmlDoc = hw.Load(@"http://www.reciter.org/KATHEER/002002.html");
if (htmlDoc.DocumentNode != null)
{
Response.Write(htmlDoc.DocumentNode.SelectSingleNode("//tr/td").InnerText);
}
结果是这样的:
我该如何解决这个问题?
更新:
此代码工作正常。
string url = "http://www.reciter.org/KATHEER/002002.html";
string result = null;
WebClient client = new WebClient();
client.Encoding = System.Text.Encoding.GetEncoding("windows-1256");
result = client.DownloadString(url);
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(result);
if (htmlDoc.DocumentNode != null)
{
Response.Write(htmlDoc.DocumentNode.SelectSingleNode("//tr/td").InnerText);
}