Q:

Unable to Identify All Text Elements on Page with XPath

I'm trying to identify all text elements on web page. Based on several threads I've read on stackoverflow I've come up with the following XPath:
//*[normalize-space(.)=.][not(self::script or self::style or self::meta)]//.
//*[normalize-space(.)=.][not(self::script or self::style or self::meta)]//text()

However, I noticed that while this identifies several hundred text elements on Amazon product page, it leaves out some important ones.
For example:
On this page I am not able to identify the 'features' section and order by time section:

"Echo Show brings you everything you love about Alexa.."
'Want it tomorrow.."

On this page I cannot identify the description section (immediately to the right of product image)
Both of these pages have text that are prominently displayed on the page so I do not see why it is not identifying them accordingly.
I'm aware that some of these text are under ul/li tags but I don't think this is the issue.
Finally, would it be possible to combine the said XPath with another attribute value so it only identifies text elements with given attribute value (i.e,  //*[normalize-space(.)=.][not(self::script or self::style or self::meta)]//. + .//*[@id='XYZ'])
Thanks

A:

Try using:

//*[text()[not(normalize-space()='')]]

That will select any element that has a text() node as a direct child that isn’t just whitespace.

