How to scrap a specific element of a website using php? : I'm trying to scrap a specific element of a website using php. I tried a few techniques using simple_html_dom but unsuccesfully. Basically I want to scrap the current variation of btc's price (a pourcentage) present on so many website.

I tried 2 ways but none of them worked: using simple_html_dom's find() method and getElementbyId(); and basically the same but with a string output at the end with saveXML(). The element that i want is inside <span id="centval"> % </span> so I tried to look for this specific id.

``` php
 require_once 'lib/simple_html_dom.php';

 $source_url = 'https://bitcointicker.co/';

 $html_source = file_get_html($source_url);
 
 $changes = $html_source->find('span')->plaintext;
 $changes->getElementById('centval');
```

And

```php

function getElementByIdAsString() {
    $pretty = true;
    $url = 'https://bitcointicker.co/';
    $id = "centval";
    $doc = new DOMDocument();
    @$doc->loadHTMLFile($url);
    $element = $doc->getElementById($id);
    echo $doc->saveXML($element);
}
```

So I expected my page to output the pourcentage of variation in the btc price but it didn't output anything, still loading, so I guess I'm doing something wrong but I can't see what :x