问题
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