如何从网页中获取链接资源?

发布于 2024-12-04 02:19:17 字数 386 浏览 0 评论 0原文

我正在编写一个小型应用程序,我需要从网页获取链接的资源,例如

<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 技术交流群。

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

发布评论

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

评论(1

回首观望 2024-12-11 02:19:17

如果这是一个小项目,并且您已经有解析页面的工作代码,请使用它。

如果您正在寻找更好/推荐的方法来解析页面的 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.

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