Question: I am trying to select some webelement on 
 "<http://www.espncricinfo.com/england-v-new-zealand-2015/engine/match/743953.html>". Here I want to select total runs scored by the player and extras on first table except total runs. I have made below xpath but it is also taking total runs. may i know how to avoid "Total Runs"

```
//table[1][@class='batting-table innings']/tbody/tr/td[4]

```

Thanks in advance

Answer: 
Total runs has class `total-wrap` in the `<tr>` tag. You can look for element without this class using `not`

```
//table[1][@class='batting-table innings']/tbody/tr[not(@class='total-wrap')]/td[4]

```
```
(//table[1][@class='batting-table innings']/tbody/tr/td[4])[position()!=last()]

```

I do not think it's good idea to compose such complex xpath is a good idea.
Mabey you can get the full list and get rid of last one:

```
result.pop()

```