M
M
Maxwell0122022-04-13 11:24:16
Python
Maxwell012, 2022-04-13 11:24:16

How to click alternately on several completely identical buttons (python selenium)?

There are several completely identical buttons, you need to make money on each one in turn, I use the following button search: browser.find_element(By.NAME, value = "check").click(), is it possible to do something so that when searching, it would find with the beginning of the first button and pressed, then the second, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexbprofit, 2022-04-13
@Maxwell012

Loop through the result of find_elements(By,NAME, value= "check") and click on each element
. So:

for item in driver.find_elements(By.NAME, value="check"):
  item.click()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question