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"/>
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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'.Thank you very much for your answer.
No problem, best of luck with Odoo!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
0
kwi 20
|
4579 | |||
|
|
1
sie 19
|
7471 | ||
|
1
paź 16
|
7665 | |||
|
4
lis 25
|
4671 | |||
|
1
lut 25
|
3472 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.