Reputation: 3
The HTML code is given below, i want all the text in <p>
tag including text in both <strong>
tags.
<p>
<strong>
<strong class="location">لاہور: </strong>
پاکستانی اداکار فواد خان کا کہنا ہے کہ پاکستان اور انڈیا کے درمیان سیاسی تناؤ کا اثر ان کے بالی وڈ میں موجود افراد سے تعلقات پر بالکل نہیں پڑا لیکن موجودہ صورتحال میں ساتھ کام کرنا آسان نہیں ہے۔
</strong>
</p>
Upvotes: 0
Views: 33
Reputation: 460
if I reading your question correctly you just want the text in the strong elements and not all the html
this should get the text in the first strong element
$x("//p/strong/text()[last()]")
and this should get the text in the nested strong element
$x("//p/strong/strong/text()")
Upvotes: 0