我想div class="post"
在一个 nodeValue 中检索所有 p 标签。这是我的 HTML:
<div class="blogEntry expecting featured featured-post-today%e2%80%99s-top-story first">
<h2><a href="/2013/09/03/rachel-zoe-pregnant-expecting-second-child/" rel="bookmark" title="Permanent Link to Rachel Zoe Expecting Second Child">Rachel Zoe Expecting Second Child</a></h2>
<div class="post">
<p>Sometext</p>
<p>someothertext</p>
</div>
<div class="blogEntry expecting featured featured-post-today%e2%80%99s-top-story first">
<h2><a href="someurl" rel="bookmark" title="Permanent Link to Rachel Zoe Expecting Second Child">sometitle</a></h2>
<div class="post">
<p>Sometext</p>
<p>someothertext</p>
</div>
</div>
这是我的xpath:
$finder->query('//div[contains(@class,"blogEntry")]//div[@class="post"]//p');