Simple storeAttribute or storeText?

I want to get the text from this xpath:
//*[@id=“ds-rental-home-values”]/div/div[1]/div/div/div/p/text()[1]

There are two text nodes under p: text()[1] = $1,000 which is the value I want, and text()[2] = /mo

When I use storeText I get this stored “$1,000/mo” with quotations because of the line break.

Is there a way for me to just get text()[1] (without splitting with execute javascript sandbox)? If I can’t get it with storeText can I get it with storeAttribute?

I used a conditional like //*text[1][contains(.,"$")] and it found the 1,000/mo And when I changed the above //*text[2][contains(.,"")] it did not return anything.
So I know the filtering on specific text nodes is functioning. But I can’t get storeText or storeAttribute to store and output a specific text node - it either pulls in all the text or none of it

I don’t know why the dollar sign ‘$’ is not showing up in the second contains expression above…

Why you can not use split function ?

Add split o replace command and you solve your problem

I don’t want to use split because it makes it longer. There is a way to reference different text nodes in xpath using text()[1], [2], … [n] but I can’t get it to return a specific node using storeText. It will only return the array of text nodes as a string it seems, if there are multiple nodes

Try this but it’s very complicates and you risk to need more and more time to do this simple work sourceextract sourcesearch

https://ui.vision/rpa/docs/selenium-ide/sourceextract-sourcesearch