-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Click on elements by index #1561
Answered
by
mdmintz
KolyStudio
asked this question in
Q&A
-
Hi, i'm trying to click on elements by index
That's how i'm doing on selenium actually
test = driver.find_elements(By.CLASS_NAME, "Ewflr")[0].click();
test = driver.find_elements(By.CLASS_NAME, "Ewflr")[1].click();
I tried this, but it didn't find it
self.click("div.Ewflr")[0]
self.click("div.Ewflr")[1]
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
mdmintz
Oct 22, 2022
For that, you may want to use:
self.click_nth_visible_element(selector, number)
In your case, it would be:
self.click_nth_visible_element("div.Ewflr", 1) self.click_nth_visible_element("div.Ewflr", 2)
Replies: 1 comment 1 reply
-
For that, you may want to use:
self.click_nth_visible_element(selector, number)
In your case, it would be:
self.click_nth_visible_element("div.Ewflr", 1) self.click_nth_visible_element("div.Ewflr", 2)
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
Answer selected by
mdmintz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment