In the code below, how do I grab all the information in class=’pageHeading’ using Xpath without grabbing whatever data is in the <span> tags?
The information I am after is simply: ‘Shiny Hair Accessories’
This is what I have tried so far:
//*[@class='pageHeading' | //*[not(contains(@class, 'smallText'))]
//*[@class='pageHeading' and //*[not(contains(@class, 'smallText'))]
This is the code I am working on:
<td class="pageHeading" valign="top">
Shiny Hair Accessories
<br>
<span class="smallText">[10672]</span>
<br>
<span class="smallText">UPC no. : 817953901653672</span>
</td>
I figured it out. The text() function got the first layer of text belonging to the element with the class ‘pageHeading’ while ignoring the span tags, like I needed.