Reputation:
I'm trying to get the content in article/div/p
but only the date after the <br>
tag. How is that done?
<article>
<h2>Man rescued after falling into Crater Lake</h2>
<p class="summary highlight">
Man rescued after falling 800 feet into Crater Lake in Oregon
</p>
<div class="body">
<p>by Joe Sutton<br>
June 11, 2019
</p>
</div>
</article>
$expression = "article/div/p";
Upvotes: 2
Views: 249
Reputation: 111541
This XPath,
//br/following-sibling::text()
will select all following sibling text nodes after br
.
Upvotes: 1