从网站 ASP.NET MVC3 中提取元数据

发布于 2024-12-22 03:28:36 字数 179 浏览 4 评论 0原文

我一直在兜圈子试图从外部网站提取元标记信息。我开始使用 XML 方法,但由于标签链接文档类型等,我的应用程序不断抛出错误。

我现在采用 HttpResponse 方法,我知道如何恢复网站并将其作为字符串存储在变量中,但

我不知道如何从元标记的内容中提取子字符串?

几天来我一直在寻找这个问题的解决方案。

I have been going round in circles trying to extract meta tag information from external websites. I started of with a XML approach but due to tags link doctype etc, my application kept throwing errors.

I am now taking a HttpResponse approach, I know how to get the website back and stored in a variable as a string but

I can't figure out how to extract a substring from the content in the meta tags?

I have been searching for a solution to this problem for days.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

眉目亦如画i 2024-12-29 03:28:36

使用 HTML Agility Pack 下载、解析和查询外部 HTML。

Use the HTML Agility Pack to download, parse and query the external HTML.

梦里兽 2024-12-29 03:28:36

我从未尝试过使用元标记,但对于 HTML 文档,Html Agility Pack 是一个很好的解决方案。有关一些示例,请参阅此博客文章

I never tried it with meta tags but for HTML documents is the Html Agility Pack a good solution. For some examples see this blog post.

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