Symfony\Component\DomCrawler\Crawler
Crawler eases navigation of a list of \DOMNode objects.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class Crawler
extends SplObjectStorage
{
- // members
- protected string $uri;
- // methods
- public void __construct()
- public void clear()
- public void add()
- public null|void addContent()
- public void addHtmlContent()
- public void addXmlContent()
- public void addDocument()
- public void addNodeList()
- public void addNodes()
- public void addNode()
- public Crawler eq()
- public array each()
- public Crawler reduce()
- public Crawler first()
- public Crawler last()
- public Crawler siblings()
- public Crawler nextAll()
- public Crawler previousAll()
- public Crawler parents()
- public Crawler children()
- public string attr()
- public string text()
- public string html()
- public array extract()
- public Crawler filterXPath()
- public Crawler filter()
- public Crawler selectLink()
- public Crawler selectButton()
- public Link link()
- public array links()
- public Form form()
- public static string xpathLiteral()
- protected void getNode()
- protected void sibling()
- // Inherited methods from SplObjectStorage
- public void addAll()
- public void attach()
- public bool contains()
- public int count()
- public current()
- public void detach()
- public string getHash()
- public mixed getInfo()
- public int key()
- public void next()
- public bool offsetExists()
- public mixed offsetGet()
- public void offsetSet()
- public void offsetUnset()
- public void removeAll()
- public void removeAllExcept()
- public void rewind()
- public string serialize()
- public void setInfo()
- public void unserialize()
- public bool valid()
Hierarchy
Extends
Members
protected
- $uri — string
Methods
protected
public
- __construct() — Constructor.
- add() — Adds a node to the current list of nodes.
- addContent() — Adds HTML/XML content.
- addDocument() — Adds a \DOMDocument to the list of nodes.
- addHtmlContent() — Adds an HTML content to the list of nodes.
- addNode() — Adds a \DOMNode instance to the list of nodes.
- addNodeList() — Adds a \DOMNodeList to the list of nodes.
- addNodes() — Adds an array of \DOMNode instances to the list of nodes.
- addXmlContent() — Adds an XML content to the list of nodes.
- attr() — Returns the attribute value of the first node of the list.
- children() — Returns the children nodes of the current selection
- clear() — Removes all the nodes.
- each() — Calls an anonymous function on each node of the list.
- eq() — Returns a node given its position in the node list.
- extract() — Extracts information from the list of nodes.
- filter() — Filters the list of nodes with a CSS selector.
- filterXPath() — Filters the list of nodes with an XPath expression.
- first() — Returns the first node of the current selection
- form() — Returns a Form object for the first node in the list.
- html() — Returns the first node of the list as HTML.
- last() — Returns the last node of the current selection
- link() — Returns a Link object for the first node in the list.
- links() — Returns an array of Link objects for the nodes in the list.
- nextAll() — Returns the next siblings nodes of the current selection
- parents() — Returns the parents nodes of the current selection
- previousAll() — Returns the previous sibling nodes of the current selection
- reduce() — Reduces the list of nodes by calling an anonymous function.
- selectButton() — Selects a button by name or alt value for images.
- selectLink() — Selects links by name or alt value for clickable images.
- siblings() — Returns the siblings nodes of the current selection
- text() — Returns the node value of the first node of the list.
- xpathLiteral() — Converts string for XPath expressions.
Inherited from SplObjectStorage
public
- addAll() — Adds all objects from another storage
- attach() — Adds an object in the storage
- contains() — Checks if the storage contains a specific object
- count() — Returns the number of objects in the storage
- current() — Returns the current storage entry
- detach() — Removes an object from the storage
- getHash() — Calculate a unique identifier for the contained objects
- getInfo() — Returns the data associated with the current iterator entry
- key() — Returns the index at which the iterator currently is
- next() — Move to the next entry
- offsetExists() — Checks whether an object exists in the storage
- offsetGet() — Returns the data associated with an object
- offsetSet() — Associates data to an object in the storage
- offsetUnset() — Removes an object from the storage
- removeAll() — Removes objects contained in another storage from the current storage
- removeAllExcept() — Removes all objects except for those contained in another storage from the current storage
- rewind() — Rewind the iterator to the first storage element
- serialize() — Serializes the storage
- setInfo() — Sets the data associated with the current iterator entry
- unserialize() — Unserializes a storage from its string representation
- valid() — Returns if the current iterator entry is valid