I am trying to select the first p element who's direct preceding sibling is also a p element. I have highlighted the below code with example of what i am looking for please.
<h2>Machine Operator / Print Operator</h2>
<p>Are you self-motivated with a..</p> <!-- THIS NODE -->
<p>The ideal candid...</p>
<p>Hours of Work Monday- Friday 07.30-16.30</p>
<p>Start pay from £8.00 per hour</p>
<p> Immediate Start</p>
<h2><a href="../../contact.php">Apply For This Vacancy</a></h2>
<p><a href="../industrial.htm">Return to Industrial Vacancies</a></p>
You can use
//p[preceding-sibling::*[self::p]] to select all
p elements where the nearest preceding sibling element is also a
p element, however it would select more than one
p in your sample as several
p elements have another
p element as the nearest preceding sibling element.