Help

0

How to access text content using Xpath

Avatar
Kahina

Hello,

I am using Odoo15, and I am trying to access the text content in the following XML code :



I have tried using //div/text() and also //div[contains(text(), 'On hand: ')] but that did not work. Can anyone help me?


Avatar
Discard
2Answers
0
Avatar
Odoo Mates
Best Answer

If you need to change the On hand string, try replacing the entire div

Avatar
Discard
0
Avatar
NISHANT JAIN
Best Answer

You can try this expr

expr="//*[text()='On hand: ']"

2Comments
Avatar
Discard
Avatar
Kahina
-

I get the following error when accessing the view :
" the element cannot be located in the parent view "

Avatar
NISHANT JAIN
-

can you share your code ?