Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to perform Xpath looping?

Tags:

selenium

xpath

While working on selenium,I have the xpath

//tbody[@id='se-tbody-result']//tr[3]//a

I want to loop tr[value] from tr[3] to tr[20].

like image 208
TodayILearned Avatar asked Jan 07 '23 09:01

TodayILearned


1 Answers

Such xPath would return you values from tr[3] til tr[20]

//tbody[@id='se-tbody-result']//tr[position()>=3 and position()<=20]//a
like image 113
Dmytro Pastovenskyi Avatar answered Jan 11 '23 22:01

Dmytro Pastovenskyi