WebClient 显示奇​​怪的字符

发布于 2025-01-03 11:15:18 字数 505 浏览 2 评论 0原文

我正在尝试下载此网站: http://tnid.us/lookup/5705544911/

并且过滤掉数据以获得“原始电话公司”等,但它显示的是这些数据,而不是应该显示的内容:

 <p class="lt">Estimated Region:<br /><strong>&#80;&#101;&#110;&#110;&#115;&#121;&#108;&#118;&#97;&#110;&#105;&#97;</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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北风几吹夏 2025-01-10 11:15:18

您看到的数据是 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.

慈悲佛祖 2025-01-10 11:15:18

这就是 HTML

您正在寻找HTML Agility Pack

That's HTML.

You're looking for the HTML Agility Pack.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文