Crawler::attr()

string|null attr(string $attribute) Returns the attribute value of the first node of the list. Parameters string $attribute The attribute name Return Value string|null The attribute value or null if the attribute does not exist Exceptions InvalidArgumentException When current node is empty

Crawler::addXmlContent()

addXmlContent(string $content, string $charset = 'UTF-8', int $options = LIBXML_NONET) Adds an XML content to the list of nodes. The libxml errors are disabled when the content is parsed. If you want to get parsing errors, be sure to enable internal errors via libxmluseinternalerrors(true) and then, get the errors via libxmlgeterrors(). Be sure to clear errors with libxmlclear_errors() afterward. Parameters string $content The XML content string $charset The charset int $options Bi

Crawler::children()

Crawler children() Returns the children nodes of the current selection. Return Value Crawler A Crawler instance with the children nodes Exceptions InvalidArgumentException When current node is empty

Crawler::addDocument()

addDocument(DOMDocument $dom) Adds a \DOMDocument to the list of nodes. Parameters DOMDocument $dom A \DOMDocument instance

Crawler::addHtmlContent()

addHtmlContent(string $content, string $charset = 'UTF-8') Adds an HTML content to the list of nodes. The libxml errors are disabled when the content is parsed. If you want to get parsing errors, be sure to enable internal errors via libxmluseinternalerrors(true) and then, get the errors via libxmlgeterrors(). Be sure to clear errors with libxmlclear_errors() afterward. Parameters string $content The HTML content string $charset The charset

Crawler::addContent()

addContent(string $content, null|string $type = null) Adds HTML/XML content. If the charset is not set via the content type, it is assumed to be ISO-8859-1, which is the default charset defined by the HTTP 1.1 specification. Parameters string $content A string to parse as HTML/XML null|string $type The content type of the string

Crawler::addNodeList()

addNodeList(DOMNodeList $nodes) Adds a \DOMNodeList to the list of nodes. Parameters DOMNodeList $nodes A \DOMNodeList instance

Crawler::addNodes()

addNodes(array $nodes) Adds an array of \DOMNode instances to the list of nodes. Parameters array $nodes An array of \DOMNode instances

Crawler::addNode()

addNode(DOMNode $node) Adds a \DOMNode instance to the list of nodes. Parameters DOMNode $node A \DOMNode instance

Crawler::add()

add(DOMNodeList|DOMNode|array|string|null $node) Adds a node to the current list of nodes. This method uses the appropriate specialized add*() method based on the type of the argument. Parameters DOMNodeList|DOMNode|array|string|null $node A node Exceptions InvalidArgumentException When node is not the expected type.