PHP Classes

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

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 57%Total: 1,404 All time: 2,780 This week: 455Up
Version License PHP version Categories
cssquery 1.0MIT/X Consortium ...5.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 S
Name: Sam S <contact>
Classes: 9 packages by
Country: United States United States
Age: 49
All time rank: 34540 in United States United States
Week rank: 214 Up28 in United States United States Up
Innovation award
Innovation award
Nominee: 8x

  Files folder image Files (2)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,404
This week:0
All time:2,780
This week:455Up
User Ratings User Comments (1)
 All time
Utility:81%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:81%StarStarStarStarStar
Tests:-
Videos:-
Overall:57%StarStarStar
Rank:1613
 
very interesting to parse the DOM
15 years ago (Roberto Aleman)
70%StarStarStarStar