Marcel
Marcel

Reputation: 31

xpath syntax for selecting the text after <strong> tag

<div class="article_details">
<h1>Product name is</h1>
<div class="left">
<ul class="article_list">
<li>
<strong>art. nr.:</strong>
VS7896
</li>
<li>
<b>Shipping time</b>
: 1-3 Days
</li>
</ul>
</div>

I used //DIV[@class='left']/UL[1]/LI[1] but the result is "art. nr.: VS7896".

Please help me with the correct XPath to select just "VS7896".

Upvotes: 3

Views: 7434

Answers (1)

choroba
choroba

Reputation: 241758

To select the text after <strong>, use

//strong/following-sibling::text()[1]

Upvotes: 5

Related Questions