从网站 ASP.NET MVC3 中提取元数据
我一直在兜圈子试图从外部网站提取元标记信息。我开始使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 HTML Agility Pack 下载、解析和查询外部 HTML。
Use the HTML Agility Pack to download, parse and query the external HTML.
我从未尝试过使用元标记,但对于 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.