Definition at line 8 of file Xpath.php.
◆ getElementsCountForXpath()
static getElementsCountForXpath |
( |
|
$xpath, |
|
|
|
$html |
|
) |
| |
|
static |
Get elements count for XPath
- Parameters
-
- Returns
- int
Definition at line 17 of file Xpath.php.
19 $domDocument = new \DOMDocument(
'1.0',
'UTF-8');
20 libxml_use_internal_errors(
true);
21 $domDocument->loadHTML($html);
22 libxml_use_internal_errors(
false);
23 $domXpath = new \DOMXPath($domDocument);
24 $nodes = $domXpath->query($xpath);
25 return $nodes->length;
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/framework/Magento/TestFramework/Helper/Xpath.php