开发者

Selenium link with class

开发者 https://www.devze.com 2023-02-15 11:55 出处:网络
I need to click all dinamic page links with same @class.Is there a way to do that in 开发者_运维知识库selenium?Did you try using element position in xPath like a[@class=\'sameClass\'][1]?I would get a

I need to click all dinamic page links with same @class.Is there a way to do that in 开发者_运维知识库selenium?


Did you try using element position in xPath like a[@class='sameClass'][1]?


I would get a count of the HTML elements with the class using getxpathcount. Then loop over those elements and within the loop perform a click. I've written some functions that do this. Basically get an xpath count. Loop over the count to get the xpath's, stuff into an array. Loop over array with a click.

0

精彩评论

暂无评论...
验证码 换一张
取 消