Skip some <tr> and loop

Subscribe to Skip some <tr> and loop 2 posts, 2 voices

 
Avatar backip 1 post

Hi, I try to parse this

<table> <tr> <td> .... </td> </tr> <tr this> <td>...</td> </tr> </table>

I have this xpath

.../table/tr (2)

I have to skip the first row and then I have to interrate over the rest rows in the Table. How can I do this.

Peter B

 
Avatar scrubber 437 posts

Sure… use the select_indices functionality.

it works like this:

book 'catch 22' do
  author 'J. Heller'
end.select_indices(:all_but_first)

This will give you, well I am sure you guessed it, all but first books.