I am extracting value of an HTML element attribute. but that attribute itself contains another HTML element inside it. So is there anyway i can extract the HTML element value from that attribute?
Here's the element
<div data-content="<i>10%</i><b>C</b>"></div>
and I am trying to get value which is inside <b>C</b>
i.e. C
I have tried the below xpath:
//div/@data-content
Please help is there anyway.
You had a typo in your XML. I assume it's supposed to be:
<div data-content="<i>10%</i><b>C</b>"></div>>
if so, try this and see if it gets you there:
substring-after((//div/@data-content),'<b>')