php - Xpath getting multiple p tags in one nodeValue -
i'd retrieve of p tags within div class="post"
in 1 nodevalue. here 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 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 rachel zoe expecting second child">sometitle</a></h2> <div class="post"> <p>sometext</p> <p>someothertext</p> </div> </div>
here xpath:
$finder->query('//div[contains(@class,"blogentry")]//div[@class="post"]//p');
it should :
$finder->query('//div[contains(@class,"blogentry")]/div[@class="post"]/p');
Comments
Post a Comment