Question: Using Dom Crawler to get only text (without tag).

```
$html = EOT<<<
  <div class="coucu">
    Get Description <span>Coucu</span>
  </div>
EOT;

$crawler = new Crawler($html);
$crawler = $crawler->filter('.coucu')->first()->text();

```

*output:* Get Description Coucu

*I want to output (only):* Get Description 

***UPDATE:***

I found a solution for this: (but it's really bad solution)

```
...
$html = $crawler->filter('.coucu')->html();
// use strip_tags_content in https://php.net/strip_tags
$html = strip_tags_content($html,'span');

```

Answer: 
Based on the criteria within your question, I think you would be best served by modifying your CSS Selector to: `$crawler = $crawler->filter('div.coucu > span')`

From there you can go `$span_text = $crawler->text();`

or to simplify things: `$text = $crawler->filter('div.coucu > span')->text();`

The [text() method](http://api.symfony.com/2.7/Symfony/Component/DomCrawler/Crawler.html#method_text) returns the value of the first item within the list.
This works nicely without hacky workarounds:

```
$crawler->filter('.coucu')->children()->each(function (Crawler $crawler) {
    $crawler->getNode(0)->parentNode->removeChild($crawler->getNode(0));
});
$crawler->text(); // Get Description

```