PHP Класс Habari\HTMLDoc

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$dom DomDocument
$xp DOMXPath

Открытые методы

Метод Описание
__construct ( string $html ) Create a HTMLDoc object
__toString ( ) : string Render this DOM as a string
create ( string $html ) : HTMLDoc Fluent constructor for HTMLDoc objects
find ( string $find ) : HTMLNodes Find elements in the DOM based on CSS selector
find_one ( string $find ) : HTMLNode Find the first element in the DOM based on a CSS selector
get ( ) : string Return the HTML represented by the DOM
query ( string $expression, DomNode $contextnode = null, boolean $registerNodeNS = true ) : HTMLNodes Pass a query on to the XPath query method

Описание методов

__construct() публичный Метод

Create a HTMLDoc object
public __construct ( string $html )
$html string The HTML to parse

__toString() публичный Метод

Render this DOM as a string
public __toString ( ) : string
Результат string the string representation of the DOM

create() публичный статический Метод

Fluent constructor for HTMLDoc objects
public static create ( string $html ) : HTMLDoc
$html string The HTML to parse
Результат HTMLDoc An instance of the HTMLDoc object created

find() публичный Метод

Find elements in the DOM based on CSS selector
public find ( string $find ) : HTMLNodes
$find string A CSS selector
Результат HTMLNodes A list of qualifying nodes

find_one() публичный Метод

Find the first element in the DOM based on a CSS selector
public find_one ( string $find ) : HTMLNode
$find string A CSS selector
Результат HTMLNode A qualifying node

get() публичный Метод

Return the HTML represented by the DOM
public get ( ) : string
Результат string The requested HTML

query() публичный Метод

Pass a query on to the XPath query method
public query ( string $expression, DomNode $contextnode = null, boolean $registerNodeNS = true ) : HTMLNodes
$expression string An XPath expression
$contextnode DomNode The context of the query, by default, the root node
$registerNodeNS boolean true by default, false to disable the automatic registration of the context node
Результат HTMLNodes A list of qualifying nodes

Описание свойств

$dom публичное свойство

public DomDocument $dom
Результат DomDocument

$xp публичное свойство

public DOMXPath $xp
Результат DOMXPath