Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
5175 Lượt xem

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?


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can try this expr

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

can you share your code ?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 22
6636
3
thg 4 21
8357
2
thg 6 20
5612
1
thg 10 19
4586
1
thg 3 15
13787