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: 
```php
function extractCurrentText(Crawler $crawler)
{
  $clone = new Crawler();
  $clone->addHTMLContent("<body><div>" . $crawler->html() . "</div></body>", "UTF-8");
  $clone->filter("div")->children()->each(function(Crawler $child) {
    $node = $child->getNode(0);
    $node->parentNode->removeChild($node);
  });
  return $clone->text();
}

```
```
$div = $crawler->filter('.coucu')->html();
$span = $crawler->filter('.coucu > span')->html();
$text = strip_tags(str_replace($span,'',$div));

```