Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3 Antworten
5178 Ansichten

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
Verwerfen
Beste Antwort

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

Avatar
Verwerfen
Beste Antwort

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

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

Avatar
Verwerfen
Beste Antwort

You can try this expr

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

Avatar
Verwerfen
Autor

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

can you share your code ?

Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Apr. 22
6638
3
Apr. 21
8358
2
Juni 20
5615
1
Okt. 19
4588
1
März 15
13789