Why do inner text is not active的innerText在simple_html_dom
[这里是HTML代码]
<ul class="product">
<li class="product col-md-4 col-sm-4 col-xs-6 "><div class="product-header">
<a href="/so-mi-octopus-xanh-soc-trang-p5163098.html">
<img src="//cdn.nhanh.vn/cdn/store/17863/ps/20170925/0ctopus_thumb_450x600.jpg" class="attachment-shop_catalog size-shop_catalog wp-post-image">
</a><div class="buttons">
<a href="/so-mi-octopus-xanh-soc-trang-p5163098.html" rel="nofollow" class="button add_to_cart_button">
<i class="fa fa-shopping-bag" aria-hidden="true"></i>
<span class="screen-reader-text">Thêm vào giỏ</span></a>
<a data-product_id="5163098" class="button btnFav" rel="nofollow">
<i class="fa fa-heart-o" aria-hidden="true"></i>
<span class="screen-reader-text">Yêu thích</span>
</a></div></div><h3><a href="/so-mi-octopus-xanh-soc-trang-p5163098.html">Sơ mi Octopus xanh sọc trắng</a></h3><span class="price">
<span class="woocommerce-Price-amount amount">
400,000 ₫ </span>
</span></li>
</ul>
[这里是我的代码]
<?php
require "simple_html_dom.php";
$html=file_get_html("http://zuhaus.vn/zu-design-pc150502.html?page=1");
$ds=$html->find("ul.products li");
foreach ($ds as $sp) {
# code...
$price=$sp->find("span.price span",0);
echo $price;
$name=$sp->find("h3 a",1)->innertext;
echo $name;
}
?>
我已经尝试了很多的测试用例但它不会工作:“< T汉克斯你 P/S我用库simple_html_dom
请将代码放在问题中,而不是在外部网站上。在您自助**后,StackOverflow上的用户将帮助您。参观:http://stackoverflow.com/tour。做一些研究:https://meta.stackoverflow.com/q/261592/1011527。 了解如何发布好问题:http://stackoverflow.com/help/how-to-ask。和http://stackoverflow.com/help/mcve。 – Nic3500