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
Post a Comment