تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
5191 أدوات العرض

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 ?

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 22
6644
3
أبريل 21
8365
2
يونيو 20
5634
1
أكتوبر 19
4596
1
مارس 15
13807