I have a webpage which has multiple submit buttons. I want to loop through them and click on each of them one by one.
I know I can do it via xpath like this (//button[@class='submit'])[i] (where i = loop number).
But I wanted to know if it's possible to do via CSS selector?
I've tried button.submit but it will always click on the first button and I want to be able to loop through. I've also tried button.submit:first-child but it seems to do the same thing.
The following is similar to what the HTML is like.
<div>
<button class="submit" type="button"></button>
</div>
<div>
<button class="submit" type="button"></button>
</div>
<div>
<button class="submit" type="button"></button>
</div>
loop()to be able to loop?