Login   Register  
PHP Classes
elePHPant
Icontem

CSS Query: Get elements from an HTML page using CSS selectors

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2009-08-05 (5 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,344 All time: 2,682 This week: 1,541Up
Version License PHP version Categories  
cssquery 1.0MIT/X Consortium License5.0HTML, XML, PHP 5
Description Author  

This class can be used to get elements from an HTML document using CSS selectors similar to Xpath.

It can load an HTML document and perform queries for elements using CSS selectors as query parameters. The search may be applied to the whole document or just to a list of document elements.

The class returns an array of document elements as DOMNode objects that match the query.

Innovation Award  
PHP Programming Innovation award nominee
June 2009
Number 2


Prize: One subscription to the PDF edition of the PHP Architect magazine
CSS is a standard that allows you to assign style properties to elements in a page that match a given selector path to match elements by class or identifier.

This class provides a solution to search and extract page elements using the CSS selector path specification.

Manuel Lemos
Picture of Sam Shull
Name: Sam Shull <contact>
Classes: 9 packages by
Country: United States United States
Age: 38
All time rank: 36940 in United States United States
Week rank: 560 Down62 in United States United States Down
Innovation award
Innovation award
Nominee: 8x

  Files folder image Files  
File Role Description
Accessible without login Plain text file CSSQuery_test.php Example An example of many selector uses
Accessible without login Plain text file CSSQuery.php Class The class file

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,344All time:2,682
 This week:0This week:1,541Up
 User Comments (1)  
 
very interesting to parse the DOM
5 years ago (Roberto Aleman)
70%StarStarStarStar