İçereği Atla
Menü
Bu soru işaretlendi
3 Cevaplar
5060 Görünümler

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
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
En İyi Yanıt

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

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

Avatar
Vazgeç
En İyi Yanıt

You can try this expr

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

Avatar
Vazgeç
Üretici

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

can you share your code ?

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Nis 22
6300
3
Nis 21
8134
2
Haz 20
5460
1
Eki 19
4428
1
Mar 15
13628