我是新手,我正在使用php库“ PHP Simple HTML DOM Parser”来获取该网站上产品的价格和日期: http://www.mercadopublico.cl/TiendaFicha/Ficha?idProducto=1557392
This image shows the values that I want to obtain
This information delivers the inspect elements
我有以下代码:
<?php
include('simplehtmldom/simple_html_dom.php');
// get DOM from URL or file
$html = file_get_html('http://www.mercadopublico.cl/TiendaFicha/Ficha?idProducto=1557392');
// find all span tags with id=spPrecio
foreach($html->find('span#spPrecio') as $e)
echo $e->outertext . '<br>';
?>
但是我无法获得所需的东西,只能得到标题h3之类的数据。我尝试了许多解决方案,但对我没有任何帮助,请给我帮助。
谢谢。