Web Scrap PHP does not work with a link

0

Hello everyone, I'm scraping a page with the following code:

<?php
require('simple_html_dom.php'); //Libreria
$url = "https://www.exito.com/products/MP00550000000204/Televisor+LG+Led+43+Pulgadas+Full+HD+Smart+TV+43LJ550T"; //Link del producto
$html = new simple_html_dom();
$html->load_file($url);
$post = $html->find('p[class=price offer]', 0)->plaintext;
$resultado = str_replace ( ".0", '', $post);
echo $resultado;
?>

If I run the script with the URL it has assigned it works and shows me the following price: 1186900

But if I change the link to this link

It does not work anymore, it does not show me anything.

What am I doing wrong? Well these prices are within the same label with the same class.

I appreciate your answers.

NOTE: To test the script, you need the simple_html_dom-php download here

and Additional this is just for testing, I'm learning this and I'm rehearsing just with pages like this, I'm not looking for a specific end.

Thanks

    
asked by Juan Fernandez 26.02.2018 в 02:36
source

0 answers