PHP equivalent of PyQuery or Nokogiri? [closed]

社会主义新天地 提交于 2019-12-03 18:05:57

问题


Basically, I want to do some HTML screen scraping, but figuring out if it is possible in PHP.

In Python, I would use PyQuery. In Ruby, I would use Nokogiri.


回答1:


In PHP you can use phpQuery

P.S. it's kinda ironic, I came to this page looking for phpQuery equivalent in Python :)




回答2:


In PHP for screen scraping you can use Snoopy (http://sourceforge.net/projects/snoopy/) or Simple HTML DOM Parser (http://simplehtmldom.sourceforge.net/)




回答3:


Here's a PHP port of Ruby nokogiri




回答4:


The closest thing to Nokogiri in PHP is this one.




回答5:


There are also the built in PHP DOM libraries. They include DomDocument with its loadHTML() method for parsing html from a string and DomElement and DomNode for building up HTML via an object.



来源:https://stackoverflow.com/questions/2815726/php-equivalent-of-pyquery-or-nokogiri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!