imarc/pluck

A simple CSS driven DOMDocument wrapper

dev-master / 1.x-dev 2015-11-16 19:56 UTC

This package is auto-updated.

Last update: 2024-12-29 04:16:11 UTC


README

A DOM CSS selector engine

Installation

Pluck uses Symfony's CSS-Selector for converting CSS selectors to XPath queries. Please ensure you have this package available. If you're using composer your standard composer install should fetch it as a requirement.

Usage

$html = <<<EOD
<!DOCTYPE html>
<html>
  <body>
		<a class="button" href="#">Hello There</a>
	</body>
</html>
EOD;

$dom = new Pluck\Document($html);
$dom->find('a.button')->remove();

To Do

  • Finish Documentation
  • Write Tests

Credits

  • While this library does not try to mimic jQuery, it will surely always be inspired by it.