Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
5172 Переглядів

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?


Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Найкраща відповідь

xpath locating by text() (contents) breaks in translated context.

So you'll get the error "element cannot be located in the parent view".

Аватар
Відмінити
Найкраща відповідь

You can try this expr

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

Аватар
Відмінити
Автор

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

can you share your code ?

Related Posts Відповіді Переглядів Дія
1
квіт. 22
6636
3
квіт. 21
8357
2
черв. 20
5609
1
жовт. 19
4582
1
бер. 15
13787