(PHP) Simple html dom library doesn't work for prices

I am trying to get the price of a product and put it in Woocommerce with the simple html dom library and cURL, but that doesn’t work. Does somebody know how I should fix this?

For example I can’t get it to print the price. A normal string of text like the name of the product does get printed.

//**START cURL Scraper function

//include simple html dom library



function curl_download($Url){

if (!function_exists('curl_init')){

die('cURL is not installed. Install and try again.');



//initiating cURL and downloading the webpage

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $Url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_COOKIE, 'countryCookie=%7B%22code%22%3A%22EE%22%2C%22name%22%3A%22Estonia%22%2C%22currency%22%3A%22EUR%22%7D');

$output = curl_exec($ch);



//Create DOM object and load the html string from cURL

$html = new simple_html_dom();



//Get the product price

$product_price = $html->find('.item_now_price', 0);

$product_price = $product_price->plaintext;

$product_price = trim($product_price,'€');

$product_price = str_replace(",",".",$product_price);

//update_post_meta( 2278, '_purchase_price', esc_attr( $product_price ) );


//Return values in an associative array

return array('product_price' => $product_price);



$curlArray = curl_download('https://www.banggood.com/Casual-Sports-Running-Ajustable-Waist-Bag-Nylon-Waterproof-5_5inch-Phone-Bag-Storage-Crossbody-Bags-p-1136261.html?rmmds=home-right-flashDeal&cur_warehouse=CN');


//**END cURL Scraper