8000 [DomCrawler] Added return of element name in `extract()` method by andrey-helldar · Pull Request #10646 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[DomCrawler] Added return of element name in extract() method #10646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,13 @@ Extract attribute and/or node values from the list of nodes::

$attributes = $crawler
->filterXpath('//body/p')
->extract(array('_text', 'class'))
->extract(array('_name', '_text', 'class'))
;

.. note::

Special attribute ``_text`` represents a node value.
Special attribute ``_text`` represents a node value, while ``_name`` represents element name.
Attribute ``_name`` will be added in version 4.3.

Call an anonymous function on each node of the list::

Expand Down
0