Php 使用Zend_Dom_查询的html下面的元素选择器是什么 $299.99 添加到购物车 |
我想要Php 使用Zend_Dom_查询的html下面的元素选择器是什么 $299.99 添加到购物车 |,php,regex,zend-studio,Php,Regex,Zend Studio,我想要 添加到购物车 在上面的html中使用zend_dom_query那么您的代码在哪里?你试过什么? <div class="product-info" style="min-height: 190px;"> <h2 class="product-name"><a title="Ottoman" href="">Ottoman</a></h2> <div class="price-box"
添加到购物车
在上面的html中使用zend_dom_query那么您的代码在哪里?你试过什么?
<div class="product-info" style="min-height: 190px;">
<h2 class="product-name"><a title="Ottoman" href="">Ottoman</a></h2>
<div class="price-box">
<span id="product-price-51" class="regular-price">
<span class="price">$299.99</span></span>
</div>
<div class="ratings">
<div class="rating-box">
<div style="width:69%" class="rating"></div>
</div>
<span class="amount"><a onclick="var t = opener ? opener.window : window; t.location.href=''; return false;" href="#">4 Review(s)</a></span>
</div>
<div class="actions">
<button onclick="setLocation('')" class="button btn-cart" title="Add to Cart" type="button"><span><span>Add to Cart</span></span></button>
<ul class="add-to-links">
<li><a class="link-wishlist" href="">Add to Wishlist</a></li>
<li><span class="separator">|</span><a class="link-compare" href="/">Add to Compare</a></li>
</ul>
</div>
</div>
use Zend\Dom\Query;
$dom = new Query($html);
$result = $dom->execute('.btn-cart');