I have following html structure -
<p>
<span class="font-weight-medium">
Phone Number:
</span>
<br>
<span>(123) 456-7869</span>
</p>
Now I want to select all such span which have phone number using pure javascript or css selector. I am using x-ray. I had tried this but this doesn't seems to work.
x(html,'span[contains(text(),"Phone Number")]')
(function(err, obj) {
console.log(obj);
});