Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
5054 Zobrazení

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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

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

Avatar
Zrušit
Nejlepší odpověď

You can try this expr

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

Avatar
Zrušit
Autor

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 Odpovědi Zobrazení Aktivita
1
dub 22
6276
3
dub 21
8108
2
čvn 20
5424
1
říj 19
4406
1
bře 15
13600