콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
4690 화면

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
4월 22
5799
3
4월 21
7558
2
6월 20
4984
1
10월 19
4117
1
3월 15
13161