Selenium: How to get text from within an html tag which has another tag in it
<a class="spf-link current" href="/orders/returns?offset=0&limit=25"> <span class="pg-helpText">Page</span> 1 </a>
I need to read the value '1' in my test. When I do a get text using css-selector .spf-link.current, it gets me "Page 1". I only need '1'. How do I exclude the text from the span tag.
The childNodes property returns a collection of a node's child nodes, as a NodeList object.
The nodes in the collection are sorted as they appear in the source code and can be accessed by index numbers. The index starts at 0.
This should give you the value 1 as
Page 1 on the basis of
space. But, i would prefer
Let me know if you have any queries.