C
C
Chichi2015-05-03 09:28:17
Parsing
Chichi, 2015-05-03 09:28:17

How to parse a specific list element using Xpath?

I have this list in html:

<ul class="params">
                    <li> <span>Марка:</span> Casio </li>                  
                    <li> <span>Пол:</span> мужские </li>           
                    <li> <span>Корпус:</span> Пластик </li>
                    <li> <span>Браслет:</span> Пластик </li>
  </ul>

I'm trying to parse exactly the "Bracelet" parameter. So I'm trying to do this:
//ul[@class="params"]/li[text()[contains(.,'bracelet')]]
But that doesn't work. Tell me how to extract a specific element of the parameter list?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Vsk, 2015-05-03
@ChicoId

It's not clear why you don't have span, but text is present
So contains is case sensitive. If you need case-insensitive - then read stackoverflow.com/questions/8474031/case-insensiti...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question