Download the PHP package dimabdc/php-fast-simple-html-dom-parser without Composer
On this page you can find all versions of the php package dimabdc/php-fast-simple-html-dom-parser. 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 php-fast-simple-html-dom-parser
PHP Fast Simple HTML DOM Parser
PHP Fast Simple HTML DOM Parser - fast and low mamory usage HTML DOM Parser with syntax like PHP Simple HTML DOM Parser
Установка
Для установки выполните команду:
composer require dimabdc/php-fast-simple-html-dom-parser
Быстрый старт
Как создать HTML DOM объект
Как искать HTML DOM элементы?
Основа
Часто используемое
Слекторы потомков
Вложенные селекторы
Фильтр атрибутов
Filter | Description |
---|---|
[attribute] | Matches elements that have the specified attribute. |
[!attribute] | Matches elements that don't have the specified attribute. |
[attribute=value] | Matches elements that have the specified attribute with a certain value. |
[attribute!=value] | Matches elements that don't have the specified attribute with a certain value. |
[attribute^=value] | Matches elements that have the specified attribute and it starts with a certain value. |
[attribute$=value] | Matches elements that have the specified attribute and it ends with a certain value. |
[attribute*=value] | Matches elements that have the specified attribute and it contains a certain value. |
Текст, комментарии
Доступ к атрибутам
Получение, установка и удаление атрибутов
"Магические" атрибуты
Attribute Name | Usage |
---|---|
$e->tag | Read or write the tag name of element. |
$e->outertext | Read or write the outer HTML text of element. |
$e->innertext | Read or write the inner HTML text of element. |
$e->plaintext | Read or write the plain text of element. |
Трюки
Прогон по DOM-дереву
Method | Description |
---|---|
mixed $e->children([int $index]) |
Returns the Nth child object if index is set, otherwise return an array of children. |
Element $e->parent() |
Returns the parent of element. |
Element $e->first_child() |
Returns the first child of element, or null if not found. |
Element $e->last_child() |
Returns the last child of element, or null if not found. |
Element $e->next_sibling() |
Returns the next sibling of element, or null if not found. |
Element $e->prev_sibling() |
Returns the previous sibling of element, or null if not found. |
API-справочник
Методы и свойства DOM
Name | Description | |
---|---|---|
void __construct([string |
Element $html]) | Constructor $html is text or Element. |
string plaintext |
Returns the contents extracted from HTML. | |
mixed find (string $selector [, int $index]) |
Find elements by the CSS selector. Returns the Nth element object if index is set, otherwise return an array of object. |
Методы и свойства элементов
Name | Description |
---|---|
string [attribute] |
Read or write element's attribure value. |
string tag |
Read or write the tag name of element. |
string outertext |
Read or write the outer HTML text of element. |
string innertext |
Read or write the inner HTML text of element. |
string plaintext |
Read or write the plain text of element. |
mixed find (string $selector [, int $index]) |
Find children by the CSS selector. Returns the Nth element object if index is set, otherwise, return an array of object. |
Прогон по дереву DOM
Name | Description |
---|---|
mixed $e->children([int $index]) |
Returns the Nth child object if index is set, otherwise return an array of children. |
element $e->parent() |
Returns the parent of element. |
element $e->first_child() |
Returns the first child of element, or null if not found. |
element $e->last_child() |
Returns the last child of element, or null if not found. |
element $e->next_sibling() |
Returns the next sibling of element, or null if not found. |
element $e->prev_sibling() |
Returns the previous sibling of element, or null if not found. |
camelCase эквиваленты
All versions of php-fast-simple-html-dom-parser with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6
ext-dom Version *
ext-libxml Version *
ext-simplexml Version *
symfony/css-selector Version *
ext-dom Version *
ext-libxml Version *
ext-simplexml Version *
symfony/css-selector Version *
The package dimabdc/php-fast-simple-html-dom-parser contains the following files
Loading the files please wait ....