任何用于 ruby​​ 的 html/css 解析库PHP?

发布于 2024-08-18 11:01:09 字数 158 浏览 1 评论 0原文

我即将完成使用 mechanize&ruby 解析/抓取网站的脚本。

我将来需要将我的脚本移植到 PHP。

我的问题是

  • 是否有任何库可用于 ruby​​ 和 php,或者
  • 是否有人可以推荐任何其他方法?

I am about to finish my script that parses/scrapes website using mechanize&ruby.

I need to port my script to PHP in the future.

My question is

  • if there is any library available for both ruby and php or
  • if anybody can recommend any other approach to this?

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

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

发布评论

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

评论(4

最舍不得你 2024-08-25 11:01:09

没有与 Ruby 和 Mechanize 同等的 PHP 语言。

然而,Zend_Framework 提供了一些很棒的与抓取相关的库,包括

There's no PHP equivalent of Ruby and Mechanize.

However, Zend_Framework offers some great scraping-related libraries including

黄昏下泛黄的笔记 2024-08-25 11:01:09

作为标准,PHP 附带了几种用于解析 XML 的工具(DOM 工具可以处理许多格式错误的 HTML),

请参阅

https://www.php.net/manual/en/refs.xml.php

C.

As standard, PHP comes with several tools for parsing XML (and the DOM one can cope with a lot of badly formed HTML)

See

https://www.php.net/manual/en/refs.xml.php

C.

吃颗糖壮壮胆 2024-08-25 11:01:09

对于 PHP 中的 DOM 操作,请使用 DOMDocument 类

简单又容易:)

For DOM manipulation in PHP use the DOMDocument class

Simple and easy :)

怪异←思 2024-08-25 11:01:09

另一个 PHP DOM 操作工具是 phpQuery

Another DOM manipulation tool for php is phpQuery.

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