Crawler::getBaseHref()

string getBaseHref() Returns base href. Return Value string

Crawler::form()

Form form(array $values = null, string $method = null) Returns a Form object for the first node in the list. Parameters array $values An array of values for the form fields string $method The method for the form Return Value Form A Form instance Exceptions InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement

Crawler::first()

Crawler first() Returns the first node of the current selection. Return Value Crawler A Crawler instance with the first selected node

Crawler::filterXPath()

Crawler filterXPath(string $xpath) Filters the list of nodes with an XPath expression. The XPath expression is evaluated in the context of the crawler, which is considered as a fake parent of the elements inside it. This means that a child selector "div" or "./div" will match only the div elements of the current crawler, not their children. Parameters string $xpath An XPath expression Return Value Crawler A new instance of Crawler with the filtered list of nodes

Crawler::filter()

Crawler filter(string $selector) Filters the list of nodes with a CSS selector. This method only works if you have installed the CssSelector Symfony Component. Parameters string $selector A CSS selector Return Value Crawler A new instance of Crawler with the filtered list of nodes Exceptions RuntimeException if the CssSelector Component is not available

Crawler::extract()

array extract(array $attributes) Extracts information from the list of nodes. You can extract attributes or/and the node value (_text). Example: $crawler->filter('h1 a')->extract(array('_text', 'href')); Parameters array $attributes An array of attributes Return Value array An array of extracted values

Crawler::eq()

Crawler eq(int $position) Returns a node given its position in the node list. Parameters int $position The position Return Value Crawler A new instance of the Crawler with the selected node, or an empty Crawler if it does not exist

Crawler::each()

array each(Closure $closure) Calls an anonymous function on each node of the list. The anonymous function receives the position and the node wrapped in a Crawler instance as arguments. Example: $crawler->filter('h1')->each(function ($node, $i) { return $node->text(); }); Parameters Closure $closure An anonymous function Return Value array An array of values returned by the anonymous function

Crawler::count()

int count() Return Value int

Crawler::clear()

clear() Removes all the nodes.