python - Taking only 1 on 3 <tr> -


i'm parsing website extract data in python using xpaths.

but don't know how thing :

<tr> </tr> <tr> </tr> <tr> data </tr> <tr> </tr> <tr> </tr> <tr> data </tr> <tr> </tr> <tr> </tr> <tr> data </tr> 

i know can //tr[3] thrid one. how can thirds ?

use position funxtion , take remainder of division 3. because xpath understand 0 false, can write

//tr[not(position() mod 3)] 

Comments

Popular posts from this blog

javascript - Feed FileReader from server side files -

java - How to create your own button and Use it with Scene Builder for javafx -

c++ - Drawing a circle in directx 9 -