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

Watching this sample code, how to xpath pointing to the second element called "example_a"?:

<span class="example_a"/>
<span class="example_b"/>
<span class="example_a"/>
아바타
취소
베스트 답변

Hi Roberto,

If you'd gave all classes an unique name you could do the following:

<xpath expr="//span[@class='example_a']>
    <!-- Some code here -->
</xpath>
But, since this is not the case, you should just use an index. For example:

<xpath expr="//span[3]">
    <!-- Some code here -->
</xpath>
This will search the third element that is a span. This code literally says 'get me the third item that is a span'.
Yenthe
아바타
취소
작성자

Thank you very much for your answer.

No problem, best of luck with Odoo!

관련 게시물 답글 화면 활동
0
4월 20
3706
1
8월 19
6410
1
10월 16
6559
1
2월 25
2604
3
12월 24
2310