This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DomCrawler
Fabien Potencier ab42e9cbc4 Merge branch '2.3' into 2.4
* 2.3: (34 commits)
  Fix #8205 : Deprecate file mode update when calling dumpFile
  Fix #10437: Catch exceptions when reloading a no-cache request
  Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
  removed ini check to make uploadedfile work on gae
  Update OptionsResolver.php
  fixed comment in forms.xml file
  Clean KernelInterface docblocks
  Cast the group name as a string
  Fixed doc of InitAclCommand
  [Form] Fix "Array was modified outside object" in ResizeFormListener.
  Fix IBAN validator
  [Process] Remove unreachable code + avoid skipping tests in sigchild environment
  Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute
  Added travis_retry to .travis.yml
  [Process] fix some typos and refactor some code
  [Process] Fix unit tests in sigchild disabled environment
  [Process] Trow exceptions in case a Process method is supposed to be called after termination
  fixed typo
  [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started
  [Process] Fix escaping on Windows
  ...

Conflicts:
	src/Symfony/Component/DomCrawler/Crawler.php
	src/Symfony/Component/Filesystem/Filesystem.php
	src/Symfony/Component/Process/Process.php
2014-03-26 12:35:33 +01:00
..
Field Merge branch '2.3' into 2.4 2014-02-18 17:29:54 +01:00
Tests Merge branch '2.3' into 2.4 2014-03-26 12:35:33 +01:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md fixed CS 2013-12-17 14:01:50 +01:00
composer.json updated version to 2.4 2013-05-16 09:54:39 +02:00
Crawler.php Merge branch '2.3' into 2.4 2014-03-26 12:35:33 +01:00
Form.php Merge branch '2.3' into 2.4 2014-03-26 12:35:33 +01:00
FormFieldRegistry.php [DomCrawler] Fixed a fatal error when setting a value in a malformed field name. 2013-06-08 13:27:47 +02:00
LICENSE update year on licenses 2014-01-07 08:19:25 -05:00
Link.php [DomCrawler] Added support for <area> tags to be treated as links 2014-02-11 14:35:22 +00:00
phpunit.xml.dist made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +01:00
README.md updated the composer install command to reflect changes in Composer 2013-09-18 09:27:26 +02:00

DomCrawler Component

DomCrawler eases DOM navigation for HTML and XML documents.

If you are familiar with jQuery, DomCrawler is a PHP equivalent:

use Symfony\Component\DomCrawler\Crawler;

$crawler = new Crawler();
$crawler->addContent('<html><body><p>Hello World!</p></body></html>');

print $crawler->filterXPath('descendant-or-self::body/p')->text();

If you are also using the CssSelector component, you can use CSS Selectors instead of XPath expressions:

use Symfony\Component\DomCrawler\Crawler;

$crawler = new Crawler();
$crawler->addContent('<html><body><p>Hello World!</p></body></html>');

print $crawler->filter('body > p')->text();

Resources

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/DomCrawler/
$ composer.phar install
$ phpunit