Reputation: 479
having the following XML code:
<div class="content">
<ul>
<li>
<b>Item model number:</b>
FCC5302Q-2
</li>
</ul>
I used this xpath expression to select the li node text:
//*[contains(@class, "content")]//li[b/text()="item model number"]/text()
And for some reason it fails to pick the text of the li element. Where am I going wrong with this?
Upvotes: 0
Views: 494
Reputation: 4487
Try this XPath..
//*[contains(@class, 'content')]//li/b[text()='Item model number:']/text()
Upvotes: 1
Reputation: 362007
Make sure you write the <b>
element text verbatim, including case.
//*[contains(@class, "content")]//li[b/text()="Item model number:"]/text()
Upvotes: 0