Download the PHP package rdx/js-dom without Composer
On this page you can find all versions of the php package rdx/js-dom. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package js-dom
JS-like DOM traversal in PHP.
Uses PHP's native DOMDocument
and Symfony's CssSelector
.
use rdx\jsdom\Node;
$doc = Node::create(file_get_contents('pathe.html'));
// Find 1 element. Returns Node|null.
$section = $doc->query('section.schedule-simple');
// Find all elements. Returns array.
$movies = $section->queryAll('.schedule-simple__item');
foreach ($movies as $movie) {
// Every element is a Node.
$a = $movie->query('h4 > a');
// Every element has an innerText/textContent.
$title = $a->getText();
// Attributes are array access.
$href = $a['href'];
}
Known issues:
- Won't select cross-current, like
querySelector[All]
does:
Document:body > section > div
Current:section
Selector:body div
Should match the div, but it doesn't. (jQuery doesn't either.)
All versions of js-dom with dependencies
PHP Build Version
Package Version
Requires
symfony/css-selector Version
^3.1 || ^4.0 || ^5.0 || ^6.0
The package rdx/js-dom contains the following files
Loading the files please wait ....