Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
5076 Представления

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
6329
3
апр. 21
8169
2
июн. 20
5485
1
окт. 19
4460
1
мар. 15
13659