【发布时间】:2014-03-10 00:09:31
【问题描述】:
我可以很好地获取源代码,但我现在希望能够从特定 div 中获取数据:
$html = file_get_contents('http://www.website.com');
说 $html 包含:
<div class="productData">
<div class="productDescription">Here is the product description</div>
<div class="productPrice">1.99</div>
</div>
我希望能够返回 内的数据,并对所有出现的情况都执行此操作?
谢谢。
【问题讨论】: