WebClient 显示奇怪的字符
我正在尝试下载此网站: http://tnid.us/lookup/5705544911/
并且过滤掉数据以获得“原始电话公司”等,但它显示的是这些数据,而不是应该显示的内容:
<p class="lt">Estimated Region:<br /><strong>Pennsylvania</strong>
而不是:
估计区域:
宾夕法尼亚州
有什么方法可以修复该问题/将其转换为 .NET?
I'm trying to download this website: http://tnid.us/lookup/5705544911/
And filter out the data in order to get the "Original Telephone Company", and etc, but it's showing this data, instead of what it should be showing:
<p class="lt">Estimated Region:<br /><strong>Pennsylvania</strong>
Instead of:
Estimated Region:
Pennsylvania
Is there any way to fix that / convert it in .NET?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您看到的数据是 HTML 编码的 ascii 值字符串。
我不知道肯定知道,但是 WebUtility.HtmlDecode 可能可以解决问题。
如果事实证明解码的内容包含 ascii 标记,那么您可以仅对由 ascii 字符表示的标记部分进行 WebUtility.HtmlEncode。
The data you're seeing is an HTML encoded string of ascii values.
I don't know for sure, but WebUtility.HtmlDecode might do the trick.
If it turns out that the decoded content contains the ascii markup, then you might be able to WebUtility.HtmlEncode only those parts of the markup which are represented by ascii characters.
这就是 HTML。
您正在寻找HTML Agility Pack。
That's HTML.
You're looking for the HTML Agility Pack.