Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
5180 มุมมอง

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 ตอบกลับ มุมมอง กิจกรรม
xpath attributes add to domain แก้ไขแล้ว
1
เม.ย. 22
6640
3
เม.ย. 21
8359
How to add notebook via xpath แก้ไขแล้ว
2
มิ.ย. 20
5617
1
ต.ค. 19
4590
1
มี.ค. 15
13792