コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
5197 ビュー

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
6645
3
4月 21
8370
2
6月 20
5640
1
10月 19
4598
1
3月 15
13810