如何从网页中获取链接资源?
我正在编写一个小型应用程序,我需要从网页获取链接的资源,例如
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://name.wordpress.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://name.wordpress.com/wp-includes/wlwmanifest.xml" />
最简单的方法是解析页面并获取我想要的内容,但我正在寻找最好的方法。
有没有直接获取RDS内容的方法? 请问有什么建议吗?
I'm writing a small application where I need to get the linked resources from a web page e.g
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://name.wordpress.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://name.wordpress.com/wp-includes/wlwmanifest.xml" />
the easiest way would be to parse the page and get what I wanted, but I'm looking best way to do it.
Is there any direct way to get RDS content?
Any suggestions, please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这是一个小项目,并且您已经有解析页面的工作代码,请使用它。
如果您正在寻找更好/推荐的方法来解析页面的 HTML,请考虑使用更成熟的方法,例如 Html Agility Pack 。
If this is a small project and you already have working code to parse the page, use it.
If you are looking for a better/recommended way to parse the HTML of a page, consider using something more mature like the Html Agility Pack.