PHP-删除包含特定文本的父项
HTML:PHP-删除包含特定文本的父项,php,xpath,extract,Php,Xpath,Extract,HTML: <div class="vm-customfield-cart"> <span class="product-field-type-S">Some important text</span><br /> <span class="product-field-type-S">Lorem ipsum dolor</span><br /> </div> <div cl
<div class="vm-customfield-cart">
<span class="product-field-type-S">Some important text</span><br />
<span class="product-field-type-S">Lorem ipsum dolor</span><br />
</div>
<div class="vm-customfield-cart">
<span class="product-field-type-S">Some important text</span><br />
</div>
最终结果应该如下所示:
<div class="vm-customfield-cart">
<span class="product-field-type-S">Some important text</span><br />
<span class="product-field-type-S">Lorem ipsum dolor</span><br />
</div>
<div class="vm-customfield-cart">
<span class="product-field-type-S">Some important text</span><br />
</div>
一些重要的文本
试试看
可能有帮助//span[以(,'Lorem ipsum')开头]